35 #ifndef IECOREMAYA_PROCEDURALHOLDER_H
36 #define IECOREMAYA_PROCEDURALHOLDER_H
40 #include "OpenEXR/ImathMatrix.h"
42 #include "IECoreGL/IECoreGL.h"
44 #include "IECoreMaya/ParameterisedHolder.h"
46 #include "IECore/ParameterisedProcedural.h"
48 #include "maya/MPxComponentShape.h"
49 #include "maya/MArrayDataBuilder.h"
53 IE_CORE_FORWARDDECLARE( Scene );
54 IE_CORE_FORWARDDECLARE( State );
55 IE_CORE_FORWARDDECLARE( BoxPrimitive );
56 IE_CORE_FORWARDDECLARE( Primitive );
57 IE_CORE_FORWARDDECLARE( Group );
58 IE_CORE_FORWARDDECLARE( NameStateComponent );
59 IE_CORE_FORWARDDECLARE( Renderer );
70 friend class ProceduralHolderUI;
78 virtual void postConstructor();
80 static void *creator();
81 static MStatus initialize();
84 virtual bool isBounded()
const;
85 virtual MBoundingBox boundingBox()
const;
86 virtual MStatus setDependentsDirty(
const MPlug &plug, MPlugArray &plugArray );
87 virtual MStatus compute(
const MPlug &plug, MDataBlock &dataBlock );
89 virtual void componentToPlugs( MObject &component, MSelectionList &selectionList )
const;
90 virtual MatchResult matchComponent(
const MSelectionList &item,
const MAttributeSpecArray &spec, MSelectionList &list );
93 MStatus
setProcedural(
const std::string &className,
int classVersion );
95 IECore::ParameterisedProceduralPtr
getProcedural( std::string *className = 0,
int *classVersion = 0 );
98 IECoreGL::ConstScenePtr
scene();
100 static MObject aGLPreview;
101 static MObject aCulling;
102 static MObject aTransparent;
103 static MObject aDrawBound;
104 static MObject aDrawCoordinateSystems;
105 static MObject aProceduralComponents;
107 static MObject aComponentQueries;
109 static MObject aComponentTransform;
110 static MObject aComponentTranslate;
111 static MObject aComponentTranslateX;
112 static MObject aComponentTranslateY;
113 static MObject aComponentTranslateZ;
114 static MObject aComponentRotate;
115 static MObject aComponentRotateX;
116 static MObject aComponentRotateY;
117 static MObject aComponentRotateZ;
118 static MObject aComponentScale;
119 static MObject aComponentScaleX;
120 static MObject aComponentScaleY;
121 static MObject aComponentScaleZ;
123 static MObject aComponentBound;
124 static MObject aComponentBoundMin;
125 static MObject aComponentBoundMinX;
126 static MObject aComponentBoundMinY;
127 static MObject aComponentBoundMinZ;
128 static MObject aComponentBoundMax;
129 static MObject aComponentBoundMaxX;
130 static MObject aComponentBoundMaxY;
131 static MObject aComponentBoundMaxZ;
132 static MObject aComponentBoundCenter;
133 static MObject aComponentBoundCenterX;
134 static MObject aComponentBoundCenterY;
135 static MObject aComponentBoundCenterZ;
143 virtual void transformUsing(
const MMatrix &mat,
const MObjectArray &componentList, MPxSurfaceShape::MVertexCachingMode cachingMode, MPointArray *pointCache );
147 mutable bool m_boundDirty;
148 mutable MBoundingBox m_bound;
151 IECoreGL::ScenePtr m_scene;
152 IECoreGL::RendererPtr m_lastRenderer;
156 typedef std::map<IECore::InternedString, std::pair< unsigned int, IECoreGL::GroupPtr > > ComponentsMap;
157 typedef std::map< int, std::set< std::pair< std::string, IECoreGL::GroupPtr > > > ComponentToGroupMap;
158 typedef std::map< int, Imath::Box3f > ComponentToBoundMap;
159 typedef std::map<IECore::InternedString, Imath::M44f> ComponentTransformsMap;
161 void buildComponents();
162 void buildComponents( IECoreGL::ConstNameStateComponentPtr nameState, IECoreGL::GroupPtr group,
const Imath::M44f &parentTransform );
164 Imath::Box3f componentBound(
int idx )
const;
166 ComponentsMap m_componentsMap;
167 ComponentToGroupMap m_componentToGroupMap;
168 ComponentTransformsMap m_componentTransforms;
170 mutable ComponentToBoundMap m_componentToBoundMap;
176 #endif // IECOREMAYA_PROCEDURALHOLDER_H
The namespace within which all CoreGL functionality is defined.
Definition: AlphaTexture.h:41
virtual void transformUsing(const MMatrix &mat, const MObjectArray &componentList, MPxSurfaceShape::MVertexCachingMode cachingMode, MPointArray *pointCache)
Definition: ProceduralHolderComponentBoundIterator.h:58
Definition: ProceduralHolder.h:68
virtual MPxGeometryIterator * geometryIteratorSetup(MObjectArray &, MObject &, bool)
MStatus setProcedural(const std::string &className, int classVersion)
Calls setParameterised( className, classVersion, "IECORE_PROCEDURAL_PATHS" ).
The IECoreMaya namespace holds all the functionality of libIECoreMaya.
Definition: BoolParameterHandler.h:44
Definition: ParameterisedHolder.h:70
IECore::ParameterisedProceduralPtr getProcedural(std::string *className=0, int *classVersion=0)
Returns runTimeCast
( getProcedural( className, classVersion ) )...
IECoreGL::ConstScenePtr scene()
Returns an up to date scene from the procedural.