00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __GOP_Guide_h_
00021 #define __GOP_Guide_h_
00022
00023 #include "GOP_API.h"
00024 #include <UT/UT_PtrArray.h>
00025 #include <GU/GU_Detail.h>
00026
00027 enum GOP_GuideType {
00028 OP_GUIDE_ONE,
00029 OP_GUIDE_TWO
00030 };
00031
00032 enum GOP_GuideListType {
00033 OP_GUIDELIST_GOPGUIDE,
00034 OP_GUIDELIST_GUDETAIL
00035 };
00036
00037 class GOP_API GOP_GuideText
00038 {
00039 public:
00040 GOP_GuideText()
00041 {
00042 text = 0;
00043 posx = posy = posz = 0;
00044 }
00045 ~GOP_GuideText()
00046 {
00047 if (text)
00048 free(text);
00049 }
00050
00051 char *text;
00052 float posx, posy, posz;
00053 };
00054
00055 class GB_PointGroup;
00056
00057
00058
00059 class GOP_API GOP_Guide : public GU_Detail
00060 {
00061 public:
00062 GOP_Guide(GOP_GuideType intype = OP_GUIDE_ONE);
00063 GOP_Guide(const GOP_Guide &source);
00064 virtual ~GOP_Guide();
00065
00066 void displayGeometry (short f) { drawGeometry = f; }
00067 void displayFont (short f) { drawAsFont = f; }
00068 void displayHulls (short f) { drawHulls = f; }
00069 void displayText (short f) { drawText = f; }
00070 void displayPrimNums (short f) { drawPrimNums = f; }
00071 void displayAsPoints (short f) { drawAsPoints = f; }
00072
00073 void displayPoints (GB_PointGroup *g)
00074 { myPointGroup = g; }
00075
00076 void displayTangentU (GB_PointGroup *g)
00077 { myTangentUGroup = g; }
00078 void displayTangentV (GB_PointGroup *g)
00079 { myTangentVGroup = g; }
00080
00081 void displayWidth (short f) { drawWidth = f; }
00082
00083 int displayGeometry () const { return drawGeometry; }
00084 int displayFont () const { return drawAsFont; }
00085 int displayHulls () const { return drawHulls; }
00086 int displayText () const { return drawText; }
00087 int displayPrimNums () const { return drawPrimNums; }
00088 int displayAsPoints () const { return drawAsPoints; }
00089
00090 GB_PointGroup *displayPoints () const { return myPointGroup; }
00091 GB_PointGroup *displayTangentU () const { return myTangentUGroup; }
00092 GB_PointGroup *displayTangentV () const { return myTangentVGroup; }
00093
00094 short displayWidth () const { return drawWidth; }
00095
00096 GOP_GuideType getType () const { return myType; }
00097
00098
00099
00100
00101 void addText(const char *word, float x, float y, float z);
00102 GOP_GuideText *getText(int i) const
00103 { return (myText) ? (GOP_GuideText*)(*myText)(i) : 0; }
00104 int numTextEntries() const
00105 { return (myText) ? myText->entries() : 0; }
00106 void clearTextEntries();
00107
00108 const UT_PtrArray<GOP_GuideText *> *getTextArray() const { return myText; }
00109
00110
00111 void buildVector(const UT_Vector3 &origin,
00112 const UT_Vector3 &direction,
00113 const GU_Detail *boxgdp);
00114
00115 void buildCurve(const GEO_Primitive *prim,
00116 GB_PointGroup *guidepts,
00117 int doU, float depth,
00118 float width1, float width2);
00119
00120 void buildDomain(const GU_Detail *srcgdp,
00121 GB_PrimitiveGroup *srcgroup,
00122 const GEO_Primitive *auxprim,
00123 int first_group,
00124 GB_PointGroup *guidepts,
00125 int doU, int loop, float ldepth,
00126 float lwidth1, float lwidth2,
00127 float rdepth, float rwidth1,
00128 float rwidth2);
00129
00130 private:
00131
00132 UT_PtrArray<GOP_GuideText *> *myText;
00133 GOP_GuideType myType;
00134
00135 GB_PointGroup *myPointGroup;
00136 GB_PointGroup *myTangentUGroup;
00137 GB_PointGroup *myTangentVGroup;
00138
00139 unsigned int drawGeometry : 1,
00140 drawAsFont : 1,
00141 drawHulls : 1,
00142 drawText : 1,
00143 drawPrimNums : 1,
00144 drawAsPoints :1;
00145
00146 short drawWidth;
00147 };
00148
00149 #endif