11#ifndef CAL_CORESUBMORPHTARGET_H
12#define CAL_CORESUBMORPHTARGET_H
15#include "cal3d/global.h"
16#include "cal3d/vector.h"
17#include "cal3d/refcounted.h"
18#include "cal3d/refptr.h"
19#include "cal3d/coresubmesh.h"
21class CAL3D_API CalCoreSubMorphTarget
23public:
friend class CalCoreSubmesh;
28 std::vector<CalCoreSubmesh::TextureCoordinate> textureCoords;
31 CalCoreSubMorphTarget();
32 virtual ~CalCoreSubMorphTarget() { }
36 int getBlendVertexCount()
const;
39 inline std::vector<BlendVertex>& getVectorBlendVertex(){
return m_vectorBlendVertex;}
40 inline const std::vector<BlendVertex>& getVectorBlendVertex()
const{
return m_vectorBlendVertex;}
42 inline BlendVertex
const * getBlendVertex(
int blendVertexId){
return &m_vectorBlendVertex[blendVertexId];}
43 inline const BlendVertex* getBlendVertex(
int blendVertexId)
const{
return &m_vectorBlendVertex[blendVertexId];}
45 virtual bool reserve(
int blendVertexCount);
47 bool setBlendVertex(
int vertexId,
const BlendVertex& vertex);
48 void getBlendVertex(
int vertexId, BlendVertex& outVertex )
const;
52 inline void setMorphTargetType(CalMorphTargetType c) { m_morphTargetType=c;}
55 inline const unsigned int&
getMorphID()
const{
return m_morphTargetID;}
58 void setName(
const std::string &s){_name=s;}
59 const std::string& getName()
const{
return _name;}
61 inline void setMorphID(
const unsigned int &i){m_morphTargetID=i;}
64 CalCoreSubMorphTarget(
const CalCoreSubMorphTarget& inOther );
66 std::vector<BlendVertex> m_vectorBlendVertex;
67 CalCoreSubmesh *m_coreSubmesh;
68 unsigned int m_morphTargetID;
69 CalMorphTargetType m_morphTargetType;
77 CalSharedDifferenceMap() : m_NextIndex(0),
78 m_vectorVertexIndexSize(0),
79 m_vectorVertexIndexPtr(0),
80 m_vectorBlendVertexPtr(0) { }
82 bool reserve(
int blendVertexCount);
88 ~CalSharedDifferenceMap() { }
91 std::vector<CalCoreSubMorphTarget::BlendVertex> m_vectorBlendVertex;
92 std::vector<int> m_vectorVertexIndex;
93 mutable int m_NextIndex;
96 mutable int m_vectorVertexIndexSize;
97 mutable const int *m_vectorVertexIndexPtr;
103class CalCoreSubMorphTargetDiffMap :
public CalCoreSubMorphTarget
106 CalCoreSubMorphTargetDiffMap();
107 CalCoreSubMorphTargetDiffMap(
const CalCoreSubMorphTargetDiffMap& inOther );
108 ~CalCoreSubMorphTargetDiffMap() { }
110 virtual bool reserve(
int blendVertexCount);
116 CalSharedDifferenceMapPtr m_diffMap;
bool appendBlendVertex(int vertexId, const CalCoreSubMorphTarget::BlendVertex &vertex)
Record one blend vertex.
Definition coresubmorphtarget.cpp:367
virtual void setCoreSubmesh(CalCoreSubmesh *inCoreSubmesh)
Record the core submesh that this morph applies to.
Definition coresubmorphtarget.cpp:328
virtual bool reserve(int blendVertexCount)
Reserves memory for the blend vertices.
Definition coresubmorphtarget.cpp:312
void setName(const std::string &s)
Name property (just for convenience )
Definition coresubmorphtarget.h:58
const unsigned int & getMorphID() const
Index of this morph for its target mesh.
Definition coresubmorphtarget.h:55
CalMorphTargetType getMorphTargetType() const
Type of this morph.
Definition coresubmorphtarget.h:51
Definition coresubmesh.h:32
bool reserve(int blendVertexCount)
Reserves memory for the blend vertices.
Definition coresubmorphtarget.cpp:184
bool appendBlendVertex(int vertexId, const CalCoreSubMorphTarget::BlendVertex &vertex)
Record one blend vertex.
Definition coresubmorphtarget.cpp:214
bool getBlendVertex(int vertexId, CalCoreSubMorphTarget::BlendVertex &outVertex) const
Retrieve one blend vertex.
Definition coresubmorphtarget.cpp:246
The vector class.
Definition vector.h:37
Derive from RefCounted to make your class have reference-counted lifetime semantics.
Definition refcounted.h:29
A container-safe smart pointer used for refcounted classes.
Definition refptr.h:11
Definition coresubmorphtarget.h:25