Cortex  10.0.0-a4
GU_CortexPrimitive.h
1 //
3 // Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // * Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // * Neither the name of Image Engine Design nor the names of any
17 // other contributors to this software may be used to endorse or
18 // promote products derived from this software without specific prior
19 // written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
34 
35 #include "UT/UT_Version.h"
36 
37 #if UT_MAJOR_VERSION_INT < 14
38 
39 #ifndef IECOREHOUDINI_GUCORTEXPRIMITIVE_H
40 #define IECOREHOUDINI_GUCORTEXPRIMITIVE_H
41 
42 #include "GU/GU_Prim.h"
43 #include "GU/GU_Detail.h"
44 #include "OP/OP_Context.h"
45 #include "OP/OP_NodeInfoParms.h"
46 
47 #include "IECore/Object.h"
48 
49 #include "IECoreHoudini/GEO_CortexPrimitive.h"
50 
51 namespace IECoreHoudini
52 {
53 
55 class GU_CortexPrimitive : public GEO_CortexPrimitive, GU_Primitive
56 {
57  public :
58 
59  GU_CortexPrimitive( GU_Detail *gdp, GA_Offset offset = GA_INVALID_OFFSET );
60  GU_CortexPrimitive( const GA_MergeMap &map, GA_Detail &detail, GA_Offset offset, const GA_Primitive &src );
61  virtual ~GU_CortexPrimitive();
62 
63  static const char *typeName;
64 
65 #if UT_MAJOR_VERSION_INT >= 13
66 
67  static GA_Primitive *create( GA_Detail &detail, GA_Offset offset, const GA_PrimitiveDefinition &definition );
68 #else
69 
70  static GA_Primitive *create( GA_Detail &detail, GA_Offset offset );
71 
72 #endif
73 
74  // merge constructor
75  static GA_Primitive *create( const GA_MergeMap &map, GA_Detail &detail, GA_Offset offset, const GA_Primitive &src );
76 
77  virtual int64 getMemoryUsage() const;
78 
79 #if UT_MAJOR_VERSION_INT >= 13
80 
81  virtual void countMemory( UT_MemoryCounter &counter ) const;
82  virtual void copyPrimitive( const GEO_Primitive *src );
83 
84 #endif
85 
86  virtual const GA_PrimitiveDefinition &getTypeDef() const;
87 
88  virtual GEO_Primitive *convert( GU_ConvertParms &parms, GA_PointGroup *usedpts = 0 );
89  virtual GEO_Primitive *convertNew( GU_ConvertParms &parms );
90  virtual void *castTo() const;
91  virtual const GEO_Primitive *castToGeo() const;
92  virtual void normal( NormalComp &output ) const;
93  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;
94 
95 #if UT_MAJOR_VERSION_INT < 13
96 
97  virtual GU_RayIntersect *createRayCache( int &persistent );
98 
99 #endif
100 
101 };
102 
103 } // namespace IECoreHoudini
104 
105 #endif // IECOREHOUDINI_GUCORTEXPRIMITIVE_H
106 
107 #endif // excluded in Houdini 14 and newer
The IECoreHoudini namespace holds all the functionality of libIECoreHoudini.
Definition: CoreHoudini.h:51
Wrapper for hosting IECore::Objects natively in Houdini.
Definition: GU_CortexPrimitive.h:55
Wrapper for hosting IECore::Objects natively in Houdini.
Definition: GEO_CortexPrimitive.h:66