16 #ifndef _trpage_geom_h_
17 #define _trpage_geom_h_
55 void SetVersion(
int major,
int minor);
57 void SetDbVersion(
int major,
int minor);
69 typedef enum {DatabaseLocal,Absolute,TileLocal} trpgTileType;
71 void SetTileOriginType(trpgTileType);
87 void SetLodRange(
const float64 *);
95 void SetMaxGroupID(
int);
100 int AddGroupID(
void);
108 bool GetVersion(
int &,
int &)
const;
110 bool GetDbVersion(
int &,
int &)
const;
138 bool GetTileOriginType(trpgTileType &)
const;
144 bool GetMaxGroupID(
int &)
const;
156 bool GetNumLods(
int32 &)
const;
182 void SetMaster(
bool isMaster)
192 bool GetIsMaster()
const
194 return ((flags &
ISMASTER)==ISMASTER);
196 void SetLocal(
bool isLocal)
206 bool GetIsLocal()
const
208 return ((flags &
ISLOCAL)==ISLOCAL);
210 void SetBlocks(
int rows,
int cols)
215 void GetBlocks(
int &rows,
int &cols)
257 enum {Alpha,Blend,Decal,Modulate,AddDetail,ModulateDetail};
259 void SetEnvMode(
int);
262 MipmapBilinear, MipmapTrilinear, Nearest};
264 void SetMinFilter(
int);
266 void SetMagFilter(
int);
271 void SetWrap(
int,
int);
284 bool GetEnvMode(
int32 &)
const;
290 bool GetMinFilter(
int32 &)
const;
292 bool GetMagFilter(
int32 &)
const;
296 bool GetWrap(
int &,
int &)
const;
366 void SetShadeModel(
int);
371 enum {Front,Back,FrontAndBack};
373 void SetCullMode(
int);
378 enum {trNone,trAlways,Equal,GreaterThanOrEqual,GreaterThan,
379 LessThanOrEqual,LessThan,Never,NotEqual};
381 enum {
None,Always,Equal,GreaterThanOrEqual,GreaterThan,
382 LessThanOrEqual,LessThan,Never,NotEqual};
385 void SetAlphaFunc(
int);
391 void SetAutoNormal(
bool);
396 void SetNumTexture(
int);
410 void SetNumTiles(
int);
415 void SetIsBumpMap(
bool);
418 enum {TR_FID,TR_SMC,TR_STP,TR_SWC};
419 void SetAttr(
int attrCode,
int val);
432 bool GetShininess(
float64 &)
const;
435 bool GetShadeModel(
int &)
const;
437 bool GetPointSize(
float64 &)
const;
439 bool GetLineWidth(
float64 &)
const;
443 bool GetCullMode(
int &)
const;
448 bool GetAlphaFunc(
int &)
const;
450 bool GetAlphaRef(
float64 &)
const;
452 bool GetAutoNormal(
bool &)
const;
454 bool GetAlpha(
float64 &)
const;
462 bool GetNumTile(
int &)
const;
467 bool GetNumTexture(
int &)
const;
479 bool GetIsBumpMap(
bool &)
const;
482 bool GetAttr(
int attrCode,
int &val)
const;
549 trpg_Directional = 0x0008,
550 trpg_BackColor = 0x0010,
551 trpg_Reflective = 0x0020,
554 trpg_Flashing = 0x0100,
555 trpg_Rotating = 0x0200,
556 trpg_ClockWise = 0x0400,
557 trpg_AnimationMask = 0x0f00,
560 trpg_Perspective = 0x1000,
562 trpg_ZBuffer = 0x4000,
563 trpg_FogPunch = 0x8000,
564 trpg_PerformerMask = 0xf000
581 } LightDirectionality;
597 transparentPixelSize(0),transparentFallofExp(0),transparentScale(0),
598 transparentClamp(0),fogScale(0) {};
641 void SetFrontIntensity(
float64 );
647 void SetBackIntensity(
float64 );
653 void SetSMC(
int32 );
656 void SetFID(
int32 );
659 void SetFlags(
int32 );
668 void SetLobeRollAngle(
float64 );
671 void SetLobeFalloff(
float64 );
680 void SetRascalSignificance(
float64 );
689 void SetCalligraphicDrawOrder(
int32 );
692 void SetCalligraphicMinDefocus(
float64 );
695 void SetCalligraphicMaxDefocus(
float64 );
701 void SetPerformerFlags(
int32 );
704 void SetPerformerMinPixelSize(
float64 );
707 void SetPerformerMaxPixelSize(
float64 );
710 void SetPerformerActualSize(
float64 );
713 void SetPerformerTpPixelSize(
float64 );
716 void SetPerformerTpFalloffExp(
float64 );
719 void SetPerformerTpScale(
float64 );
722 void SetPerformerTpClamp(
float64 );
725 void SetPerformerFogScale(
float64 );
731 void SetAnimationPeriod(
float64 );
734 void SetAnimationPhaseDelay(
float64 );
737 void SetAnimationTimeOn(
float64 );
743 void SetAnimationFlags(
int32 );
746 void SetComment(
const char *);
753 void GetFrontIntensity(
float64& );
755 void GetBackIntensity(
float64& );
757 void GetSMC(
int32& );
758 void GetFID(
int32& );
759 void GetFlags(
int32& );
760 void GetHLobeAngle(
float64& );
761 void GetVLobeAngle(
float64& );
762 void GetLobeRollAngle(
float64& );
763 void GetLobeFalloff(
float64& );
766 void GetRascalSignificance(
float64& );
769 void GetCalligraphicDrawOrder(
int32& );
770 void GetCalligraphicMinDefocus(
float64& );
771 void GetCalligraphicMaxDefocus(
float64& );
773 void GetPerformerFlags(
int32& );
774 void GetPerformerMinPixelSize(
float64& );
775 void GetPerformerMaxPixelSize(
float64& );
776 void GetPerformerActualSize(
float64& );
777 void GetPerformerTpPixelSize(
float64& );
778 void GetPerformerTpFalloffExp(
float64& );
779 void GetPerformerTpScale(
float64& );
780 void GetPerformerTpClamp(
float64& );
781 void GetPerformerFogScale(
float64& );
783 void GetAnimationPeriod(
float64& );
784 void GetAnimationPhaseDelay(
float64& );
785 void GetAnimationTimeOn(
float64& );
787 void GetAnimationFlags(
int32& );
788 const char *GetComment();
855 void SetAttrIndex(
int);
861 void GetNumVertices(
uint32 &)
const;
868 bool GetVertices(
float64 *)
const;
869 bool GetVertices(
float32 *)
const;
873 void GetAttrIndex(
int &)
const;
925 bool GetNumLightAttrs(
int &)
const;
973 void SetCategory(
const char *cat,
const char *subCat);
979 void GetCategory(
char *cat,
int maxCatLen,
char *subCat,
int maxSubCatLen)
const;
982 void SetLodInfo(
double in,
double out);
986 void GetLodInfo(
double &in,
double &out)
const;
989 void SetPriority(
int);
996 void GetPriority(
int &)
const;
1062 bool GetRange(
int id,
trpgRange &)
const;
1127 void SetNumTable(
int);
1132 void SetNumMaterial(
int);
1145 int AddMaterial(
const trpgMaterial &,
bool lookForExisting=
true);
1159 bool GetNumTable(
int &)
const;
1164 bool GetNumMaterial(
int &)
const;
1170 bool GetMaterial(
int subTable,
int matID,
trpgMaterial &)
const;
1246 typedef enum {External,Local,Global,Template} ImageMode;
1277 void SetName(
const char *);
1280 bool GetName(
char *retStr,
int strLen)
const;
1284 void SetNumTile(
int);
1297 bool GetNumTile(
int &)
const;
1300 bool GetImageMode(ImageMode &)
const;
1304 bool GetImageType(ImageType &)
const;
1313 bool GetImageDepth(
int32 &depth)
const;
1316 bool GetIsMipmap(
bool &)
const;
1319 void SetImageMode(ImageMode);
1322 void SetImageType(ImageType);
1331 void SetIsMipmap(
bool);
1340 void SetNumMipmap(
int);
1343 void SetNumLayer(
int);
1347 bool GetNumLayer(
int &)
const;
1352 int32 CalcNumMipmaps()
const;
1355 int32 CalcTotalSize()
const;
1358 int32 MipLevelSize(
int miplevel);
1361 int32 MipLevelOffset(
int miplevel);
1411 void CalcMipLevelSizes();
1449 void SetNumTextures(
int);
1466 bool GetNumTextures(
int &)
const;
1489 const trpgTexture *FindByName(
const char *name,
int &texid)
const;
1490 void SetCurrentBlock(
int row,
int col)
1548 void SetName(
const char *);
1557 void SetNumTiles(
int);
1565 bool GetType(
int &);
1568 bool GetName(
char *ret,
int strLen)
const;
1575 bool GetNumTiles(
int &)
const;
1625 void SetNumModels(
int);
1637 bool GetNumModels(
int &)
const;
1640 bool GetModel(
int modID,
trpgModel &)
const;
1660 bool FindByName(
const char *name,
unsigned int &mId);
1692 void SetMode(TileMode);
1695 void SetNumLod(
int numLod);
1698 void SetNumTiles(
int numX,
int numY,
int lod);
1703 bool GetMode(TileMode &)
const;
1723 void SetCurrentBlock(
int row,
int col,
bool local)
1770 void SetBaseMaterial(
int32 matSubTable,
int32 matID);
1785 bool GetBaseMaterial(
int32 &matSubTable,
int32 &matID)
const;
1821 bool GetNumLocals(
int &)
const;
1905 void AddMaterial(
int);
1916 void SetDate(
int32);
1920 void SetMaterial(
int no,
int id);
1924 void SetModel(
int no,
int id);
1927 bool GetNumMaterial(
int32 &)
const;
1930 bool GetMaterial(
int32 nth,
int32 &matID)
const;
1932 bool GetNumModel(
int32 &)
const;
1937 bool GetNumLocalMaterial(
int32 &)
const;
1948 const std::vector<trpgLocalMaterial> *GetLocalMaterialList(
void)
const;
1950 bool GetDate(
int32 &)
const;
1963 void SetBlockNo(
int row,
int col)
1968 void GetBlockNo(
int &row,
int &col)
2081 typedef enum {Points,LineStrips,LineLoops,Lines,Polygons,
TriStrips,
2084 void SetPrimType(PrimType type);
2087 void SetPrimLengths(
int,
const int *);
2091 void AddPrimLength(
int);
2100 void SetNumPrims(
int);
2105 void SetNumMaterial(
int);
2116 void SetMaterial(
int which,
int matID,
bool isLocal=
false);
2119 void SetMaterials(
int32 numMat,
const int32 *matIDs);
2123 int AddMaterial(
int matID);
2138 void SetVertices(
int num,
const float32 *);
2139 void SetVertices(
int num,
const float64 *);
2147 typedef enum {Overall,PerPrim,PerVertex} BindType;
2155 void SetNormals(
int num,BindType
bind,
const float32 *);
2156 void SetNormals(
int num,BindType
bind,
const float64 *);
2165 typedef enum {Ambient,Diffuse,
Specular,Emission} ColorType;
2171 void SetColors(
int num,ColorType type,BindType
bind,
const trpgColor *);
2180 void SetTexCoords(
int num,BindType
bind,
const float32 *);
2181 void SetTexCoords(
int num,BindType
bind,
const float64 *);
2183 void AddTexCoords(BindType
bind);
2187 void AddTexCoord(DataType type,
trpg2dPoint &,
int n=0);
2191 void AddTexCoord(DataType type,std::vector<trpg2dPoint> &pts);
2195 void SetEdgeFlags(
int num,
const char *);
2199 bool GetPrimType(PrimType &type)
const;
2204 bool GetNumPrims(
int &num)
const;
2212 bool GetPrimLengths(
int *lenArray)
const;
2217 bool GetNumMaterial(
int &num)
const;
2223 bool GetMaterial(
int num,
int32 &matID,
bool &isLocal)
const;
2228 bool GetNumVertex(
int &num)
const;
2235 bool GetVertices(
float32 *)
const;
2236 bool GetVertices(
float64 *)
const;
2244 bool GetNumNormal(
int &num)
const;
2250 bool GetNormals(
float32 *)
const;
2251 bool GetNormals(
float64 *)
const;
2257 bool GetNumColorSets(
int &num)
const;
2267 bool GetNumTexCoordSets(
int &)
const;
2281 bool GetNumEdgeFlag(
int &num)
const;
2284 bool GetEdgeFlags(
char *)
const;
2346 virtual void Reset(
void);
2349 virtual void SetNumChild(
int);
2351 virtual int AddChild(
void);
2354 virtual bool GetNumChild(
int &)
const;
2357 virtual void SetID(
int);
2359 virtual bool GetID(
int &)
const;
2362 void SetName(
const char* );
2364 const char* GetName(
void)
const;
2367 virtual bool isValid(
void)
const;
2450 void SetParentID(
int);
2452 bool GetParentID(
int &)
const;
2456 void SetChildPos(
int);
2461 bool GetChildPos(
int &)
const;
2485 void SetTileLoc(
int gx,
int gy,
int glod);
2488 bool GetTileLoc(
int &gx,
int &gy,
int &glod)
const;
2492 void SetTileAddress(
int32 file,
int32 offset);
2493 void SetTileZValue(
float gZmin,
float gZmax);
2494 bool GetTileAddress(
int32& file,
int32& offset)
const;
2496 bool GetTileZValue(
float& gZmin,
float& gZmax)
const;
2558 bool GetType(
int &)
const;
2568 bool GetMode(
int &)
const;
2634 void SetNumChild(
int);
2636 void SetLOD(
double in,
double out,
double width);
2641 bool GetNumChild(
int &)
const;
2644 bool GetLOD(
double &in,
double &out,
double &width)
const;
2650 bool GetID(
int &)
const;
2653 void SetName(
const char* );
2655 const char* GetName(
void)
const;
2658 void SetRangeIndex(
int ri);
2660 bool GetRangeIndex(
int &ri)
const;
2729 void SetMatrix(
const float64 *);
2732 bool GetMatrix(
float64 *)
const;
2774 void SetMatrix(
const float64 *);
2777 bool GetModel(
int32 &)
const;
2779 bool GetMatrix(
float64 *)
const;
2810 void SetMaterial(
int);
2812 int GetMaterial(
void)
const;
2815 void SetFont(std::string &);
2817 const std::string *GetFont(
void)
const;
2822 bool GetBold(
void)
const;
2825 void SetItalic(
bool);
2827 bool GetItalic(
void)
const;
2830 void SetUnderline(
bool);
2832 bool GetUnderline(
void)
const;
2835 void SetCharacterSize(
float32);
2837 float32 GetCharacterSize(
void)
const;
2874 int GetNumStyle(
void)
const;
2912 typedef enum {Line,Cylinder,MaxSupportType} SupportType;
2915 void SetType(SupportType);
2922 SupportType GetType(
void)
const;
2925 void SetMaterial(
int);
2927 int GetMaterial(
void)
const;
2963 int GetNumStyle(
void)
const;
3003 void SetType(LabelType);
3011 LabelType GetType(
void)
const;
3014 void SetFontStyle(
int);
3016 int GetFontStyle(
void)
const;
3019 void SetSupport(
int);
3021 int GetSupport(
void)
const;
3058 int GetNumProperty(
void)
const;
3095 typedef enum {Left,Center,
Right,MaxAlignmentType} AlignmentType;
3098 void SetProperty(
int);
3099 int GetProperty()
const;
3104 void SetText(
const std::string &);
3111 const std::string *GetText(
void)
const;
3114 void SetAlignment(AlignmentType);
3118 AlignmentType GetAlignment(
void)
const;
3123 int GetTab(
void)
const;
3135 void SetDesc(
const std::string &);
3141 const std::string *GetDesc(
void)
const;
3144 void SetURL(
const std::string &);
3149 const std::string *GetURL(
void)
const;
3152 void SetTabSize(
int);
3154 int GetTabSize(
void)
const;
3167 const std::vector<trpg3dPoint> *GetSupports(
void)
const;