35 #ifndef IE_COREMAYA_SCENESHAPEINTERFACE_H
36 #define IE_COREMAYA_SCENESHAPEINTERFACE_H
38 #include "IECore/SceneInterface.h"
39 #include "IECore/CompoundParameter.h"
42 #include "OpenEXR/ImathMatrix.h"
43 #include "IECoreGL/IECoreGL.h"
44 #include "maya/MPxComponentShape.h"
49 IE_CORE_FORWARDDECLARE( Scene );
50 IE_CORE_FORWARDDECLARE( State );
51 IE_CORE_FORWARDDECLARE( BoxPrimitive );
52 IE_CORE_FORWARDDECLARE( Primitive );
53 IE_CORE_FORWARDDECLARE( Group );
54 IE_CORE_FORWARDDECLARE( NameStateComponent );
55 IE_CORE_FORWARDDECLARE( Renderer );
83 virtual void postConstructor();
84 static void *creator();
85 static MStatus initialize();
87 virtual bool isBounded()
const;
88 virtual MBoundingBox boundingBox()
const;
89 virtual MStatus setDependentsDirty(
const MPlug &plug, MPlugArray &plugArray );
90 virtual MStatus compute(
const MPlug &plug, MDataBlock &dataBlock );
91 virtual MatchResult matchComponent(
const MSelectionList &item,
const MAttributeSpecArray &spec, MSelectionList &list );
93 #if MAYA_API_VERSION >= 201600
95 virtual MStatus preEvaluation(
const MDGContext &context,
const MEvaluationNode &evaluationNode );
105 virtual void transformUsing(
const MMatrix &mat,
const MObjectArray &componentList, MPxSurfaceShape::MVertexCachingMode cachingMode, MPointArray *pointCache );
110 static MObject aObjectOnly;
111 static MObject aDrawGeometry;
112 static MObject aDrawRootBound;
113 static MObject aDrawChildBounds;
114 static MObject aDrawTagsFilter;
124 IECoreGL::ConstScenePtr
glScene();
133 const std::vector< IECore::InternedString > &
componentNames()
const;
140 static MObject aTime;
141 static MObject aOutTime;
142 static MObject aOutputObjects;
143 static MObject aObjectDependency;
144 static MObject aAttributes;
145 static MObject aTransform;
146 static MObject aBound;
153 static MObject aQuerySpace;
154 static MObject aSceneQueries;
155 static MObject aAttributeQueries;
163 static MObject aConvertParamQueries;
165 static MObject aAttributeValues;
167 static MObject aTranslate;
168 static MObject aTranslateX;
169 static MObject aTranslateY;
170 static MObject aTranslateZ;
171 static MObject aRotate;
172 static MObject aRotateX;
173 static MObject aRotateY;
174 static MObject aRotateZ;
175 static MObject aScale;
176 static MObject aScaleX;
177 static MObject aScaleY;
178 static MObject aScaleZ;
180 static MObject aBoundMin;
181 static MObject aBoundMinX;
182 static MObject aBoundMinY;
183 static MObject aBoundMinZ;
184 static MObject aBoundMax;
185 static MObject aBoundMaxX;
186 static MObject aBoundMaxY;
187 static MObject aBoundMaxZ;
188 static MObject aBoundCenter;
189 static MObject aBoundCenterX;
190 static MObject aBoundCenterY;
191 static MObject aBoundCenterZ;
200 bool m_sceneInterfaceDirty;
201 bool m_previewSceneDirty;
203 IECoreGL::ScenePtr m_scene;
206 void buildScene( IECoreGL::RendererPtr renderer, IECore::ConstSceneInterfacePtr subSceneInterface );
209 void recurseBuildScene(
IECoreGL::Renderer * renderer,
const IECore::SceneInterface *subSceneInterface,
double time,
bool drawBounds,
bool drawGeometry,
bool objectOnly,
const IECore::SceneInterface::NameList &drawTags );
211 void createInstances();
214 void buildGroups( IECoreGL::ConstNameStateComponentPtr nameState, IECoreGL::GroupPtr subScene );
216 void registerGroup(
const std::string &name, IECoreGL::GroupPtr &group );
218 std::string relativePathName( IECore::SceneInterface::Path path );
219 IECore::SceneInterface::Path fullPathName( std::string relativeName );
221 Imath::M44d worldTransform( IECore::ConstSceneInterfacePtr scene,
double time );
223 Imath::Box3d componentBound(
int idx );
224 bool animatedScene();
226 void recurseCopyGroup(
const IECoreGL::Group *srcGroup, IECoreGL::Group *trgGroup,
const std::string &namePrefix );
228 bool readConvertParam( IECore::CompoundParameterPtr parameters,
int attrIndex )
const;
230 MStatus computeOutputPlug(
const MPlug &plug,
const MPlug &topLevelPlug, MDataBlock &dataBlock,
const IECore::SceneInterface *scene,
int topLevelIndex,
int querySpace, MTime &time );
232 typedef std::map< IECore::InternedString, std::pair< unsigned int, IECoreGL::GroupPtr> > NameToGroupMap;
233 typedef std::vector< IECore::InternedString > IndexToNameMap;
234 typedef std::map< IECore::MurmurHash, IECore::InternedString > HashToName;
235 typedef std::pair< IECore::InternedString, IECore::InternedString > InstanceInfo;
236 typedef std::vector< InstanceInfo > InstanceArray;
238 IndexToNameMap m_indexToNameMap;
239 NameToGroupMap m_nameToGroupMap;
240 HashToName m_hashToName;
241 InstanceArray m_instances;
244 PostLoadCallbackPtr m_postLoadCallback;
250 #endif // IE_COREMAYA_SCENESHAPEINTERFACE_H
double time() const
Return the value of the time plug for the SceneShape.
The namespace within which all CoreGL functionality is defined.
Definition: AlphaTexture.h:41
IECoreGL::ConstScenePtr glScene()
Returns the GL Scene representing the sceneInterface for the preview plug values ( objectOnly...
int selectionIndex(const IECore::InternedString &name)
Returns the internal index stored for the given path.
Definition: SceneShapeInterfaceComponentBoundIterator.h:53
const std::vector< IECore::InternedString > & componentNames() const
Returns all component names currently existing in the shape.
Definition: SceneShapeInterface.h:70
virtual void transformUsing(const MMatrix &mat, const MObjectArray &componentList, MPxSurfaceShape::MVertexCachingMode cachingMode, MPointArray *pointCache)
IECoreGL::GroupPtr glGroup(const IECore::InternedString &name)
Returns GL Group matching the given path name.
virtual IECore::ConstSceneInterfacePtr getSceneInterface()
Returns the sceneInterface for this node. Needs to be implemented by derived classes.
Definition: SceneInterface.h:69
IECore::InternedString selectionName(int index)
Returns the path name for the given index.
The IECoreMaya namespace holds all the functionality of libIECoreMaya.
Definition: BoolParameterHandler.h:44
Definition: InternedString.h:55
Definition: PostLoadCallback.h:50
Definition: Renderer.h:64
void setDirty()
Flags the GL scene as dirty, for use by derived classes.
virtual MPxGeometryIterator * geometryIteratorSetup(MObjectArray &, MObject &, bool)