apiMeshShape.h
#ifndef _apiMeshShape
#define _apiMeshShape
#include <maya/MPxSurfaceShape.h>
#include <maya/MPxGeometryIterator.h>
#include <maya/MTypeId.h>
#include <maya/MPlug.h>
#include <maya/MDataBlock.h>
#include <maya/MVectorArray.h>
#include <maya/MDoubleArray.h>
#include <maya/MSelectionList.h>
#include <maya/MSelectionMask.h>
#include <apiMeshGeom.h>
#include <apiMeshData.h>
#include <apiMeshIterator.h>
class MPointArray;
class apiMesh : public MPxSurfaceShape
{
public:
apiMesh();
virtual ~apiMesh();
virtual void postConstructor();
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
virtual bool getInternalValue( const MPlug&,
MDataHandle&);
virtual bool setInternalValue( const MPlug&,
const MDataHandle&);
virtual MStatus connectionMade( const MPlug& plug,
const MPlug& otherPlug,
bool asSrc );
virtual MStatus connectionBroken( const MPlug& plug,
const MPlug& otherPlug,
bool asSrc );
virtual MStatus shouldSave( const MPlug& plug, bool& result );
virtual void componentToPlugs( MObject &,
MSelectionList & ) const;
virtual MatchResult matchComponent( const MSelectionList& item,
const MAttributeSpecArray& spec,
MSelectionList& list );
virtual bool match( const MSelectionMask & mask,
const MObjectArray& componentList ) const;
virtual MObject createFullVertexGroup() const;
virtual MObject localShapeInAttr() const;
virtual MObject localShapeOutAttr() const;
virtual MObject worldShapeOutAttr() const;
virtual MObject cachedShapeAttr() const;
virtual MObject geometryData() const;
virtual void closestPoint ( const MPoint & toThisPoint,
MPoint & theClosestPoint,
double tolerance ) const;
virtual void transformUsing( const MMatrix & mat,
const MObjectArray & componentList );
virtual void transformUsing( const MMatrix & mat,
const MObjectArray & componentList,
MPxSurfaceShape::MVertexCachingMode cachingMode,
MPointArray* pointCache);
virtual void tweakUsing( const MMatrix & mat,
const MObjectArray & componentList,
MVertexCachingMode cachingMode,
MPointArray* pointCache,
MArrayDataHandle& handle );
virtual bool vertexOffsetDirection( MObject & component,
MVectorArray & direction,
MVertexOffsetMode mode,
bool normalize );
virtual bool isBounded() const;
virtual MBoundingBox boundingBox() const;
virtual MPxGeometryIterator*
geometryIteratorSetup( MObjectArray&, MObject&,
bool forReadOnly = false );
virtual bool acceptsGeometryIterator( bool writeable=true );
virtual bool acceptsGeometryIterator( MObject&,
bool writeable=true,
bool forReadOnly = false);
bool hasHistory();
MStatus computeInputSurface( const MPlug&, MDataBlock& );
MStatus computeOutputSurface( const MPlug&, MDataBlock& );
MStatus computeWorldSurface( const MPlug&, MDataBlock& );
MStatus computeBoundingBox( MDataBlock& );
MStatus applyTweaks( MDataBlock&, apiMeshGeom* );
bool value( int pntInd, int vlInd, double & val ) const;
bool value( int pntInd, MPoint & val ) const;
bool setValue( int pntInd, int vlInd, double val );
bool setValue( int pntInd, const MPoint & val );
MObject meshDataRef();
apiMeshGeom* meshGeom();
MObject cachedDataRef();
apiMeshGeom* cachedGeom();
MStatus buildControlPoints( MDataBlock&, int count );
void verticesUpdated();
static void * creator();
static MStatus initialize();
public:
static MObject inputSurface;
static MObject outputSurface;
static MObject worldSurface;
static MObject cachedSurface;
static MObject bboxCorner1;
static MObject bboxCorner2;
public:
static MTypeId id;
bool fHasHistoryOnCreate;
};
#endif