35 #ifndef IECOREHOUDINI_GEOCORTEXPRIMITIVE_H
36 #define IECOREHOUDINI_GEOCORTEXPRIMITIVE_H
38 #include "GA/GA_Defines.h"
39 #include "GEO/GEO_Primitive.h"
40 #include "GU/GU_Detail.h"
41 #include "GEO/GEO_Point.h"
42 #include "OP/OP_Context.h"
43 #include "OP/OP_NodeInfoParms.h"
44 #include "UT/UT_Version.h"
45 #include "UT/UT_ParallelUtil.h"
46 #include "GA/GA_Primitive.h"
47 #if UT_MAJOR_VERSION_INT >= 14
49 typedef GEO_ConvertParms ConvertParms;
53 #include "GU/GU_Prim.h"
55 typedef GU_Primitive::NormalComp NormalComp;
56 typedef GU_ConvertParms ConvertParms;
60 #include "IECore/Object.h"
72 #if UT_MAJOR_VERSION_INT < 16
73 GEO_CortexPrimitive(
const GA_MergeMap &map, GA_Detail &detail, GA_Offset offset,
const GA_Primitive &src );
77 #if UT_MAJOR_VERSION_INT < 16
78 virtual void swapVertexOffsets(
const GA_Defragment &defrag );
79 virtual GA_Size getVertexCount()
const;
80 virtual GA_Offset getVertexOffset( GA_Size index )
const;
82 virtual GA_DereferenceStatus dereferencePoint( GA_Offset point,
bool dry_run =
false );
83 virtual GA_DereferenceStatus dereferencePoints(
const GA_RangeMemberQuery &pt_q,
bool dry_run =
false );
85 #if UT_MAJOR_VERSION_INT >= 13
87 virtual void stashed(
bool beingstashed, GA_Offset offset=GA_INVALID_OFFSET );
92 virtual void stashed(
int onoff, GA_Offset offset=GA_INVALID_OFFSET );
93 virtual void clearForDeletion();
94 virtual bool isDegenerate()
const;
95 virtual void copyUnwiredForMerge(
const GA_Primitive *src,
const GA_MergeMap &map );
96 virtual void transform(
const UT_Matrix4 &xform );
97 virtual const GA_PrimitiveJSON* getJSON()
const;
98 virtual void reverse();
100 virtual GEO_Primitive * copy(
int preserve_shared_pts )
const;
101 virtual void copyPrimitive(
const GEO_Primitive *src, GEO_Point **ptredirect );
102 virtual int getBBox( UT_BoundingBox *bbox )
const;
103 virtual void enlargePointBounds( UT_BoundingBox &box )
const;
104 virtual UT_Vector3 computeNormal()
const;
105 virtual int detachPoints( GA_PointGroup &grp );
106 #if UT_MAJOR_VERSION_INT >= 16
108 bool saveVertexArray( UT_JSONWriter &w,
const GA_SaveMap &map )
const;
109 bool loadVertexArray( UT_JSONParser &p,
const GA_LoadMap &map );
113 static const char *typeName;
115 #if UT_MAJOR_VERSION_INT >=16
117 static void create(GA_Primitive **new_prims, GA_Size nprimitives, GA_Detail &detail, GA_Offset start_offset,
const GA_PrimitiveDefinition &def);
119 #elif UT_MAJOR_VERSION_INT >= 14
121 static GA_Primitive *create( GA_Detail &detail, GA_Offset offset,
const GA_PrimitiveDefinition &definition );
123 static GA_Primitive *create(
const GA_MergeMap &map, GA_Detail &detail, GA_Offset offset,
const GA_Primitive &src );
130 virtual int64 getMemoryUsage()
const;
131 virtual void countMemory( UT_MemoryCounter &counter )
const;
132 virtual void copyPrimitive(
const GEO_Primitive *src );
134 virtual const GA_PrimitiveDefinition &getTypeDef()
const;
137 static void setTypeDef( GA_PrimitiveDefinition *def );
138 static GA_PrimitiveTypeId typeId();
140 virtual GEO_Primitive *convert( ConvertParms &parms, GA_PointGroup *usedpts = 0 );
141 virtual GEO_Primitive *convertNew( ConvertParms &parms );
142 virtual void normal( NormalComp &output )
const;
143 virtual int intersectRay(
const UT_Vector3 &o,
const UT_Vector3 &d,
float tmax=1E17F,
float tol=1E-12F,
float *distance=0, UT_Vector3 *pos=0, UT_Vector3 *nml=0,
int accurate=0,
float *u=0,
float *v=0,
int ignoretrim=1 )
const;
157 static void infoText(
const GU_Detail *geo, OP_Context &context, OP_NodeInfoParms &parms );
161 #if (UT_VERSION_INT >= 0x0c050132) // 12.5.306 or later
162 virtual void copyOffsetPrimitive(
const GEO_Primitive *src, GA_Index basept );
164 virtual void copyOffsetPrimitive(
const GEO_Primitive *src,
int basept );
167 virtual bool evaluatePointRefMap( GA_Offset result_vtx, GA_AttributeRefMap &map, fpreal u, fpreal v=0, uint du=0, uint dv=0 )
const;
169 IECore::ObjectPtr m_object;
170 #if UT_MAJOR_VERSION_INT < 16
177 class geo_CortexPrimitiveJSON;
179 GEO_Primitive *doConvert( ConvertParms &parms );
181 static GA_PrimitiveDefinition *m_definition;
187 #endif // IECOREHOUDINI_GEOCORTEXPRIMITIVE_H
static void infoText(const GU_Detail *geo, OP_Context &context, OP_NodeInfoParms &parms)
The IECoreHoudini namespace holds all the functionality of libIECoreHoudini.
Definition: CoreHoudini.h:51
const IECore::Object * getObject() const
Get the IECore::Object contained by this GEO_Primitive.
Wrapper for hosting IECore::Objects natively in Houdini.
Definition: GEO_CortexPrimitive.h:66
static void setTypeDef(GA_PrimitiveDefinition *def)
void setObject(const IECore::Object *object)