18 #define __attribute__(_a)
26 #ifndef MB_NORMALPRECISION
27 #define MB_NORMALPRECISION 16
31 #if MB_NORMALPRECISION == 16
34 #define MB_NORMALMAX 32767
36 #if MB_NORMALPRECISION == 8
39 #define MB_NORMALMAX 127
41 #error MB_NORMALPRECISION must be either 8 or 16
47 #define INVALID_ID (0xffffffff)
58 inline Vertex(
void ) { m_iStrokeID = 0; m_iStates = 0; };
77 {
return ((
float)(
unsigned char)(m_iStates&0x7f)) * (1.0f/0x7f); };
86 { m_iStates = (m_iStates&0xff80)+(
unsigned int)(0x7f*fFreeze); };
90 inline float Mask(
void )
const
91 {
return ((
float)(
unsigned char)(m_iStates>>8)) * (1.0f/0xff); };
96 { m_iStates = (m_iStates&0xff)+(((
unsigned int)(0xff*fMask))<<8); };
99 inline bool IsSelected(
void )
const {
return (m_iStates&0x80) != 0; };
103 { m_iStates = (m_iStates&0xff7f)+bSelected*0x80; };
149 TC(
void ) {m_fU = m_fV = 0.0f;};
150 TC(
float fU,
float fV ) { m_fU = fU; m_fV = fV; };
158 inline TC &operator -=(
const TC &
a ) { m_fU -= a.
m_fU, m_fV -= a.
m_fV;
return *
this; };
159 inline TC &operator *=(
float f ) { m_fU *=
f, m_fV *=
f;
return *
this; };
160 inline TC &operator /=(
float f ) { f = 1.0f/
f; m_fU *=
f, m_fV *=
f;
return *
this; };
161 inline operator bool(
void )
const throw() {
return m_fU || m_fV; };
162 inline operator Vector(
void )
const throw() {
return Vector( m_fU, m_fV, 0 ); };
163 inline operator const float *(
void )
const {
return &u; };
164 void Normalize(
void );
165 float Length(
void );
192 m_iFaceIndex(iFaceIndex), m_iCornerIndex(iCornerIndex) {};
197 inline bool IsValid()
const {
return m_iCornerIndex < 0xff; }
201 inline unsigned int FaceIndex()
const {
return m_iFaceIndex; }
205 inline unsigned char CornerIndex()
const {
return m_iCornerIndex; }
208 unsigned int m_iFaceIndex;
209 unsigned char m_iCornerIndex;
229 virtual void Operator(
231 unsigned int iFaceIndex
238 unsigned int iFaceIndex
260 virtual void Operator(
262 unsigned int iVertexIndex,
263 unsigned int iFaceIndex
269 unsigned int iVertexIndex,
270 unsigned int iFaceIndex
289 virtual void ProcessAdjacentVertex(
290 unsigned int iVertexIndex,
291 unsigned int iFaceIndex
351 SurfacePoint(
void ) : m_pMesh(0), m_iFaceIndex(0xffffffff), m_fRelativeRange(0), m_bSide(false), m_pTG( NULL ) {}
356 unsigned int iVertexIndex,
357 unsigned int iFaceIndex
364 unsigned int FaceIndex(
void )
const;
367 Vector LocalPosition(
void )
const;
370 Vector WorldPosition(
void )
const;
373 Vector LocalNormal(
void )
const;
376 Vector WorldNormal(
void )
const;
379 TC TextureCoordinate(
void )
const;
382 Base TangentBase(
void )
const;
385 Vector FaceCoordinates(
void )
const;
395 unsigned int iFaceIndex,
398 bool bTwoSide =
false,
399 bool bOriginalPosition =
false
408 unsigned int iFaceIndex,
419 unsigned int iFaceIndex,
420 const Vector &vLocalPosition,
421 bool bRecalculatePosition
429 void SetTangentGenerator(
476 float fLODLevel = 1.0
f
480 virtual void CopyTo(
Node *pNode )
const;
487 virtual class Material *MaterialOverride(
void )
const;
490 inline unsigned int VertexCount(
void )
const {
return m_iVertexCount; };
494 unsigned int iVertexCount
498 inline unsigned int TCCount(
void )
const {
return m_pTCs.ItemCount(); };
501 virtual void SetTCCount(
502 unsigned int iTCCount
506 bool HasTC(
bool bIgnorePtexUV =
false )
const;
509 virtual unsigned int UVlessPaintingStatus(
void )
const;
512 virtual void SetUVlessPaintingStatus(
525 unsigned int iVertexIndex
526 )
const {
return m_pVertices[iVertexIndex]; };
530 unsigned int iVertexIndex
531 ) {
return m_pVertices[iVertexIndex]; };
535 unsigned int iVertexIndex
536 )
const {
return m_pVertices[iVertexIndex].m_vPos; };
540 unsigned int iVertexIndex
541 ) {
return m_pVertices[iVertexIndex].m_vPos; };
547 unsigned int iVertexIndex
548 )
const {
return m_pVertices[iVertexIndex].m_vPos; };
552 unsigned int iVertexTCIndex
553 )
const {
return m_pTCs[iVertexTCIndex]; };
557 unsigned int iVertexIndex
558 )
const {
return Vector( m_pVertexNormals[iVertexIndex].m_vNormal ); };
562 {
return m_pVertices[iVertexIndex].m_iStrokeID; };
575 unsigned int iVertexIndex
576 )
const {
return m_pVertices[iVertexIndex].Mask(); };
586 unsigned int iVertexIndex
587 )
const {
return m_pVertices[iVertexIndex].Freeze(); };
591 virtual unsigned int FrozenVertexCount(
void )
const;
596 unsigned int iVertexIndex
597 )
const {
return m_pVertexNormals[iVertexIndex].m_vNormal; };
602 unsigned int iVertexIndex
603 )
const {
return m_pVertexNormals[iVertexIndex].m_iNormal; };
624 unsigned int iVertexIndex,
626 ) { m_pVertices[iVertexIndex].m_vPos = vPosition; };
630 unsigned int iVertexIndex,
633 { m_pVertices[iVertexIndex].m_vPos += vPosition; };
638 m_pVertexNormals[iVertexIndex].m_vNormal[0] =
tnormal(pNormal[3]);
639 m_pVertexNormals[iVertexIndex].m_vNormal[1] =
tnormal(pNormal[2]);
640 m_pVertexNormals[iVertexIndex].m_vNormal[2] =
tnormal(pNormal[1]);
645 unsigned int iVertexIndex,
662 unsigned int iTCIndex,
664 ) { m_pTCs[iTCIndex] =
tc; }
667 virtual void SetVertexFreeze(
668 unsigned int iVertexIndex,
669 unsigned int iFaceIndex,
675 virtual void SetFreezeValues(
680 void SetVertexMask(
unsigned int iVertexIndex,
unsigned int iFaceIndex,
float fFMask );
684 { m_pVertices[iVertexIndex].m_iStrokeID = iStrokeID; };
691 Vertex &
v = m_pVertices[iIndex];
705 GetVertexID( iVertexIndex ) = CollectionID();
716 return GetVertexID( iVertexIndex ) == CollectionID();
729 IncreaseCollectionID();
742 virtual unsigned int VertexExternalIndex(
743 unsigned int iVertexIndex
748 virtual void SetVertexExternalIndex(
749 unsigned int iVertexIndex,
750 unsigned int iExternalVertexIndex
756 unsigned int iTriangleIndex,
757 unsigned int iCornerIndex
758 )
const {
return VertexPosition( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };
762 unsigned int iQuadIndex,
763 unsigned int iCornerIndex
764 )
const {
return VertexPosition( QuadIndex( iQuadIndex, iCornerIndex ) ); };
769 unsigned int iTriangleIndex,
770 unsigned int iCornerIndex
771 )
const {
return VertexTC( TriangleTCI( iTriangleIndex, iCornerIndex ) ); };
775 unsigned int iQuadIndex,
776 unsigned int iCornerIndex
777 )
const {
return VertexTC( QuadTCI( iQuadIndex, iCornerIndex ) ); };
781 unsigned int iTriangleIndex,
782 unsigned int iCornerIndex
783 )
const {
return VertexNormal( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };
787 unsigned int iQuadIndex,
788 unsigned int iCornerIndex
789 )
const {
return VertexNormal( QuadIndex( iQuadIndex, iCornerIndex ) ); };
793 unsigned int iTriangleIndex,
794 unsigned int iCornerIndex
795 )
const {
return VertexNormal( TriangleCreaseNormalIndex( iTriangleIndex, iCornerIndex ) ); };
799 unsigned int iQuadIndex,
800 unsigned int iCornerIndex
801 )
const {
return VertexNormal( QuadCreaseNormalIndex( iQuadIndex, iCornerIndex ) ); };
805 unsigned int iTriangleIndex,
806 unsigned int iCornerIndex
807 )
const {
return VertexFreeze( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };
812 unsigned int iQuadIndex,
813 unsigned int iCornerIndex
814 )
const {
return VertexFreeze( QuadIndex( iQuadIndex, iCornerIndex ) ); };
818 unsigned int iTriangleIndex,
819 unsigned int iCornerIndex
820 )
const {
return VertexNormalArray( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };
824 unsigned int iQuadIndex,
825 unsigned int iCornerIndex
826 )
const {
return VertexNormalArray( QuadIndex( iQuadIndex, iCornerIndex ) ); };
830 unsigned int iTriangleIndex,
831 unsigned int iCornerIndex
832 )
const {
return VertexNormalValue( TriangleIndex( iTriangleIndex, iCornerIndex ) ); };
836 unsigned int iQuadIndex,
837 unsigned int iCornerIndex
838 )
const {
return VertexNormalValue( QuadIndex( iQuadIndex, iCornerIndex ) ); };
851 virtual void EnumerateFaces(
852 unsigned int iFaceIndex,
854 bool bSymmetry =
false
863 virtual void EnumerateNearestFaces(
864 unsigned int iFaceIndex,
873 virtual void EnumerateNeighboringFaces(
874 unsigned int iFaceIndex,
879 virtual void EnumerateFaces(
889 virtual void EnumerateVertices(
890 unsigned int iFaceIndex,
899 unsigned int EnumerateAdjacentVertices(
901 unsigned int iVertexIndex,
902 unsigned int iFaceIndex
906 virtual void EnumerateVertices(
913 virtual int MeshVersion(
void )
const;
916 virtual void SmoothTextureCoordinates(
float fStrength);
919 virtual void RecalculateNormals(
924 virtual bool RecalculateAdjacency(
926 bool bCheckTShapes =
true
941 virtual bool IsSelected(
void );
944 virtual void SetSelected(
bool bOn =
true,
bool bMerge =
false );
952 virtual void RemoveLayer(
965 virtual bool IsActiveLevel(
void )
const;
983 virtual bool Unlock(
void );
986 virtual bool IsLocked(
void );
991 virtual class MeshChange *StartChange(
void );
994 virtual void EndChange(
bool bUndo =
true,
bool bMerge =
false);
997 virtual bool IsNSided(
void )
const;
1001 virtual unsigned int GenericFaceCount(
void );
1002 virtual void ClearGenericFaces();
1006 virtual bool HasExpandedTCs(
void )
const;
1008 virtual void CreateExpandedTCs(
void );
1010 virtual TC &ExpandedTC(
unsigned int index );
1012 virtual bool SupportsTangentMirror()
const;
1014 virtual unsigned int TangentMirroredFaceIndex(
unsigned int iFaceIndex )
const;
1016 virtual unsigned int TangentMirroredVertexIndex(
unsigned int iFaceIndex,
1017 unsigned int iCornerIndex,
1018 unsigned int &iOppositeFaceIndex,
1019 unsigned int &iOppositeCornerIndex)
const;
1030 virtual bool InitializeTopologicalSymmetry(
unsigned int iFaceIndex0,
unsigned int iFaceIndex1,
bool bSelectWhenFailed =
true );
1033 virtual bool IsTopologicalSymmetryInitialized(
unsigned int &iFaceIndex0,
unsigned int &iFaceIndex1 )
const;
1035 virtual void RecalculateTopologicalSymmetry(
void );
1039 virtual int TopologicalSide(
unsigned int iFaceIndex );
1041 virtual unsigned int PrimaryCount(
bool bNeedToUseTC);
1045 virtual unsigned int QuadPrimaryIndex(
bool bNeedToUseTC,
unsigned int iFaceIndex,
unsigned int iCornerIndex);
1049 virtual unsigned int TrianglePrimaryIndex(
bool bNeedToUseTC,
unsigned int iFaceIndex,
unsigned int iCornerIndex);
1052 virtual bool RecalculateVertexAdjacency(
1058 unsigned int iVertexIndex,
1059 unsigned int iFaceIndex,
1060 unsigned int iCornerIndex
1069 virtual void Transform(
const Matrix &mMatrix );
1071 virtual void CheckValidity( DiagnosticLevel iLevel = dgnLevel2 )
const;
1112 virtual void Freeze(
Mesh *pMesh,
Store<float> aFreezeData,
bool bMerge =
false );
1120 virtual void Select(
Mesh *pMesh,
bool bState,
const Store<unsigned int> &aSelectionData,
bool bMerge =
false );
1154 virtual Vector ConvertToTangent(
1155 unsigned int iVertexIndex,
1160 virtual Vector ConvertToObject(
1161 unsigned int iVertexIndex,
1166 virtual Base LocalBase(
1167 unsigned int iFaceIndex,
1168 unsigned int iCornerIndex
1172 virtual void SetNormalization(
1198 virtual void SetMesh(
1202 virtual void SetTolerance(
1207 const Vector &vLocalStart,
1211 float fTarget = 0.5
f
1235 virtual void SetFramebufferSize(
1236 unsigned int iWidth,
1237 unsigned int iHeight
1242 const class Camera *pCamera,
1246 bool bForceRedrawBuffer =
false
1281 virtual unsigned int MeshGridCount(
void )
const;
1285 virtual unsigned int MeshGridLevel(
1286 unsigned int iMeshGridIndex
1291 virtual unsigned int MeshGridFaceIndex(
1292 unsigned int iMeshGridIndex,
1298 virtual unsigned int MeshGridVertexIndex(
1299 unsigned int iMeshGridIndex,
1305 virtual unsigned int MeshGridTCIndex(
1306 unsigned int iMeshGridIndex,
1312 virtual unsigned int MeshGridIndexByFaceIndex(
1313 unsigned int iFaceIndex
1330 Coord(
unsigned int x,
unsigned int y,
unsigned int z )
1332 a[0] =
x;
a[1] =
y;
a[2] =
z;
1340 return a[0] == other.
a[0] &&
a[1] == other.
a[1] &&
a[2] == other.
a[2];
1351 if( fData.ItemCount() > 0 && fData[fIndex] ==
INVALID_ID )
1355 void next() {
while( ++fIndex < fData.ItemCount() && fData[fIndex] ==
INVALID_ID ); }
1356 bool isDone()
const {
return fIndex >= fData.ItemCount(); }
1357 unsigned int value()
const {
return fData[fIndex]; }
1360 unsigned int fIndex;
1370 static Coord computeDimensions(
const mudbox::Mesh* mesh,
1371 unsigned int facesPerVoxel,
1372 const Coord& minVoxels,
1373 const Coord& maxVoxels);
1379 const Coord& gridDimensions );
1392 virtual VoxelIterator voxelIterator(
const Coord& cCoord );
1398 virtual void update();
1401 virtual void extend();
1408 bool bothDirections =
false );
1435 virtual Vector SmoothPosition(
1436 unsigned int iFaceIndex,
1437 double fUCoordinate,
1438 double fVCoordinate,
1439 bool bConsiderCrease =
true,
1440 bool bConsiderHarden =
true
1444 virtual Vector SmoothNormal(
1445 unsigned int iFaceIndex,
1446 double fUCoordinate,
1447 double fVCoordinate,
1448 bool bConsiderCrease =
true,
1449 bool bConsiderHarden =
true
1453 virtual Vector SmoothTextureCoordinate(
1454 unsigned int iFaceIndex,
1455 double fUCoordinate,
1460 virtual Base SmoothTangent(
1461 unsigned int iFaceIndex,
1462 double fUCoordinate,
1463 double fVCoordinate,
1464 bool bConsiderCrease =
true,
1465 bool bConsiderHarden =
true
1485 unsigned int iVertexIndex
1497 unsigned int iVertexIndex
1509 unsigned int iVertexIndex
1510 )
const __attribute__((always_inline))
1524 VertexChange &Add_uncached(
1525 unsigned int iVertexIndex,
1526 unsigned int iFaceIndex,
1528 bool bPrecalculateLayerIndex =
false,
1529 float fDataInitialValue = 0.0
f );
1535 unsigned int iVertexIndex,
1536 unsigned int iFaceIndex,
1537 bool bPrecalculateLayerIndex =
false,
1538 float fDataInitialValue = 0.0
f
1540 ) __attribute__((always_inline))
1544 m_pArray[v.
m_iStrokeID].m_iVertexIndex == iVertexIndex )
1547 return Add_uncached(iVertexIndex, iFaceIndex, v, bPrecalculateLayerIndex, fDataInitialValue );
1562 unsigned int &m_iVertexCount;
1565 friend class ::XMesh;
1583 virtual bool Unlock(
1638 unsigned int m_MinFaceID;
1639 unsigned int m_MaxFaceID;
1640 unsigned int m_BlindInt;
1642 unsigned int m_iVersion;
1648 unsigned int AddFace(
unsigned int faceID);
1652 void DelFace(
unsigned int index)
1656 m_aInvalidIDs.
Add(index);
1662 bool Consolidate(
bool force);
1665 Partition() : m_aFaceIDs(
"Mesh Partition Faces"),
1666 m_aInvalidIDs(
"Mesh Partition Unused Entries"),
1667 m_MinFaceID(0xFFFFFFFF),
1671 m_bDirty(false) { m_AABB.
Reset(); }
1673 ~Partition() { Clear(); }
1677 m_MinFaceID = 0xffffffff; m_MaxFaceID = m_BlindInt = 0;
1678 m_bDirty =
false; m_AABB.
Reset(); m_iVersion = 0; }
1680 void Serialize( Stream &
s )
1692 Partition(
const Partition &
p) : m_aFaceIDs(p.m_aFaceIDs),
1693 m_aInvalidIDs(p.m_aInvalidIDs),
1695 m_BlindInt(p.m_BlindInt),
1696 m_bDirty(p.m_bDirty) {}
1698 Partition & operator = (
const Partition &
p) {
1699 m_aFaceIDs = p.m_aFaceIDs;
1700 m_aInvalidIDs = p.m_aInvalidIDs;
1702 m_MinFaceID = p.m_MinFaceID;
1703 m_MaxFaceID = p.m_MaxFaceID;
1704 m_BlindInt = p.m_BlindInt;
1705 m_bDirty = p.m_bDirty;
1709 const AxisAlignedBoundingBox &getBoundingBox()
const {
return m_AABB; }
1712 class InverseMapping {
1714 unsigned int m_iPartition;
1715 unsigned int m_iIndex;
1718 InverseMapping(
const InverseMapping &m) : m_iPartition(m.m_iPartition), m_iIndex(m.m_iIndex) {}
1720 InverseMapping & operator = (
const InverseMapping &m)
1721 { m_iPartition = m.m_iPartition; m_iIndex = m.m_iIndex;
return *
this; }
1723 void Serialize( Stream &s )
1731 void RegenInverseMapping();
1734 void RegenInverseMapping(
int Part);
1736 void SetPartitionCount(
unsigned int count);
1739 void MergePartitions(
unsigned int src,
unsigned int target);
1742 void SplitPartition(
unsigned int part);
1745 void RebalancePartitions(QualityHint hint);
1748 Store<Partition> m_aPartitions;
1749 Store<InverseMapping> m_aFaces;
1750 AxisAlignedBoundingBox m_TotalAABB;
1752 QualityHint m_eCurrentPartitionQuality;
1755 static QualityHint m_sDefaultQuality;
1756 static unsigned int m_sPreferredPartitionCount;
1757 static unsigned int m_sMaxPartitionSize;
1758 static bool m_sBaseMesh;
1759 static bool m_sUseFaces;
1808 virtual void OnLinked(
const TreeNode *pOldParent);
1813 void RePartition(QualityHint hint = eGood);
1816 void RecomputePartitionAABB(
unsigned int pIdx);
1819 void RecomputePartitionAABBs(
void);
1830 {
return m_aPartitions[pIdx].m_AABB; }
1834 {
return m_aPartitions[pIdx].m_MinFaceID; }
1838 {
return m_aPartitions[pIdx].m_MaxFaceID; }
1851 return m_aPartitions[pIdx].m_AABB.IsContaining(pt);
1861 void Consolidate(
bool force);
1864 void Serialize(
Stream &s );
1878 for (
unsigned int i = 0; i < m_aPartitions.ItemCount(); ++i)
1879 b |= m_aPartitions[i].m_bDirty;
1887 for (
unsigned int i = 0; i < m_aPartitions.ItemCount(); ++i)
1888 if( m_aPartitions[i].m_bDirty )
1890 m_aPartitions[i].m_bDirty =
false;
1891 m_aPartitions[i].m_iVersion++;
1899 void SetFaceCount(
unsigned int faceCount,
bool noOvergrowth =
false);
1912 {
return m_aPartitions[pIdx].m_aFaceIDs.ItemCount(); }
1918 {
return m_aPartitions[pIdx].m_aFaceIDs[fIdx]; }
1922 {
return m_aPartitions[pIdx].m_BlindInt; }
1926 { m_aPartitions[pIdx].m_BlindInt = ii; }
1931 {
return m_aPartitions[pIdx].m_iVersion; }
1935 {
return faceID < m_aFaces.ItemCount() ? m_aFaces[faceID].m_iPartition :
INVALID_ID; }
1940 {
return faceID < m_aFaces.ItemCount() ? m_aFaces[faceID].m_iIndex :
INVALID_ID; }
1948 void AddFaceToPartition(
unsigned int faceID,
unsigned int partitionID);
1952 {
return (faceID < GetFaceCount()) ? m_aFaces[faceID].m_iPartition :
INVALID_ID; }
1956 void SetBlindIntsAsColors();
void MarkVertex(unsigned int iVertexIndex)
Mark a particular vertex.
VoxelIterator(const ExtendableStore< unsigned int > &data)
void SetCollectionID(unsigned int id)
float QuadVertexFreeze(unsigned int iQuadIndex, unsigned int iCornerIndex) const
Returns the freeze value of a corner of a mesh face.
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
const QPoint operator/(const QPoint &p, qreal c)
Store< mudbox::VertexAdjacency > m_aVertexAdjacency
The MeshGrid class is an interface for dividing the surface of a mesh to grids.
void SetVertexAdjacency(unsigned int iVertexIndex, unsigned int iFaceIndex, unsigned int iCornerIndex)
Sets the adjacency data for a specified vertex. If this vertex is not touching any faces...
Generic base interface for classes implementing a freeze function.
Store< Normal > m_pVertexNormals
void SetVertexNormal(unsigned int iVertexIndex, const Vector &vNormal)
Sets the normal of the vertex with the given index.
static void SetDefaultQuality(QualityHint hint)
Set the default quality hint.
Vector QuadVertexNormal(unsigned int iQuadIndex, unsigned int iCornerIndex) const
Returns the normal of a corner of a mesh face. Can be used for quad meshes only.
aevent TopologyChange
This event is triggered when the mesh's topology has been editer.
bool m_bHasVertexAdjacency
unsigned int VertexNormalCount(void) const
unsigned int value() const
Represents a 3D vector or point with S23E8 floating point elements.
unsigned char m_iCurrentCorner
This is set to true if the original vertex passed in to Mesh::EnumerateAdjacentVertices() is on the e...
unsigned int GetPartitionCount() const
Returns the number of partitions. Partition ids are 0 through PartitionCount-1 inclusive.
A Mesh is a collection of vertices organized into faces, and optional Texture Coordinate information...
const Normal * VertexNormalArray(void) const
Vertex & VertexData(unsigned int iVertexIndex)
Returns a vertex.
tnormalv VertexNormalValue(unsigned int iVertexIndex) const
Returns the normal of the vertex with the given index as a single 64-bit signed value.
void Serialize(Stream &s)
Writes/reads the object data to/from a stream.
Vector TriangleVertexCreaseNormal(unsigned int iTriangleIndex, unsigned int iCornerIndex) const
Returns the normal of a corner of a mesh face. Can be used for triangular meshes only.
bool m_bSide
if true, the backside of the face was selected. (This is not supported; use at your own risk...
unsigned int & GetVertexID(unsigned int iIndex)
Not part of the Mesh API – used internally.
QByteArray & operator+=(QByteArray &a, const QStringBuilder< A, B > &b)
Contains generic polygon representation.
const GenericFace & operator=(const GenericFace &rhs)
Copies the face values into another instance.
void SetVertexPosition(unsigned int iVertexIndex, const Vector &vPosition)
Sets the position of the vertex with the given index.
Represents face adjacency data for a vertex.
unsigned int operator[](unsigned int i) const
bool IsPartitionCloseToPoint(unsigned int pIdx, const Vector &pt, float dist) const
returns true if a specified point is within a given (non empty) partition, or within a specified dist...
Vector m_vLocalPosition
position of the point in local space
Store< Vertex > m_pVertices
static void SetBaseMeshMode(bool b=true)
sets a static mode to use the base mesh or the current subdiv level of the mesh.
void SetPartitionBlindInt(unsigned int pIdx, unsigned int ii)
Write Accessor for blind data (32 bit uint) on each partition.
unsigned int m_iFaceIndex
Index of a face which uses the vertex.
float Freeze(void) const
Returns the Freeze value of the Vertex (between 0.0 and 1.0, where 0.0 is not frozen) ...
This is the base class for anything which is an element of a list with a fixed order and a transparen...
void SetVertexTC(unsigned int iTCIndex, const TC &tc)
Sets the Texture Coordinated(UV) value at the given index.
Store< unsigned int > m_aIndices
void SetFreeze(float fFreeze)
Sets the Freeze value of the Vertex (between 0.0 and 1.0, where 0.0 is not frozen) ...
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
void Reset(void)
Makes the box empty.
Represents a local coordinate basis comprising three axes that define a coordinate system...
unsigned int GetPartitionBlindInt(unsigned int pIdx) const
Read Accessor for blind data (32 bit uint) on each partition.
const tnormal * QuadVertexNormalArray(unsigned int iQuadIndex, unsigned int iCornerIndex) const
Returns the normal of a corner of a quad mesh face as an array of 16-bit signed values.
Represents a bounding box whose axes are aligned with the coordinate system.
static void SetDefaultPartitionCount(unsigned int pc)
Set the default partition count.
Vector VertexNormal(unsigned int iVertexIndex) const
Returns the normal of the vertex with the given index.
The SpatialGrid class is an interface for dividing the space of a mesh to grids/cells/voxels.
const tnormal * TriangleVertexNormalArray(unsigned int iTriangleIndex, unsigned int iCornerIndex) const
Returns the normal of a corner of a triangle mesh face as an array of 16-bit signed values...
Normal vector with 16 bit components.
bool IsPartitionDirty(unsigned int pIdx) const
returns true if the partition has been changed since the HWRenderer has built the VBOs for this parti...
Describes a location somewhere on the surface of a Mesh.
This is the base class for most classes in the Mudbox SDK.
const StoredVertexInfo & GetRestoreVertexInfo(unsigned int i) const
This is not part of the API – do not use. (it is here for performance reasons.)
Vector & VertexPosition(unsigned int iVertexIndex)
Returns the x,y,z position of the vertex with the given index.
void SetSelected(bool bSelected)
Sets the Selected state of the Vertex (true or false)
FaceEnumerator is a base class for operations that must be applied across mesh faces.
Coord(unsigned int x, unsigned int y, unsigned int z)
void ContentChanged(void)
Call this method after modifying the partitioning.
const Vector & OriginalPosition(unsigned int iVertexIndex) const
This function returns the position of a vertex before this change.
tnormalv QuadVertexNormalValue(unsigned int iQuadIndex, unsigned int iCornerIndex) const
Returns the normal a corner of a quad mesh face as a single 64-bit signed value.
void ClearVertexMarks(void)
Clears all vertex marks.
void Serialize(class Stream &s)
Serializes the the array and its contents from/to a stream.
This is the base class for a renderer implementation, which transforms a mesh into the opengl pipelin...
unsigned long long tnormalv
Type of the whole normal vector.
void IncreaseCollectionID(void)
Obsolete method; do not use.
bool m_bEnumerateFakeTriangles
The corner within the face that corresponds to the original vertex.
aptr< LayerMeshData > ActiveSculptLayer
This is a readonly pointer containing the address of the active sculpt layer or null if there is no a...
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
static bool IsInBaseMeshMode()
Store< unsigned int > m_aAdjacents
unsigned int GetSides(void)
Returns the sidecount for a given face.
Store< StoredVertexInfo > m_aRestoreBuffer
void Clear(bool bDestruct=false)
Clears the array and deallocates its memory.
GLsizei GLsizei GLenum GLenum const GLvoid * data
AdjacentVertexEnumerator is a base class for operations that must be applied to all vertices adjacent...
void AddVertexPosition(unsigned int iVertexIndex, const Vector &vPosition)
Adds vPosition to the current position of the vertex with the given index.
short int tnormal
Type of one component in a normal vector.
bool operator==(const Coord &other)
Vector m_vFaceCoordinates
StoredVertexInfo VertexChange
This struct holds the change information about a single vertex.
const TC & TriangleVertexTC(unsigned int iTriangleIndex, unsigned int iCornerIndex) const
Returns the texture coordinates of a corner of a mesh face.
Store< StoredVertexInfo > & GetRestoreBufferRef()
This is not part of the API – do not use. (it is here for performance reasons.)
Picker objects are used as part of the map extraction process, to find points on one mesh that most c...
This class represents a 4x4 transformation matrix.
void SetMask(float fMask)
Do not use this method.
VertexAdjacency(unsigned int iFaceIndex, unsigned char iCornerIndex)
Constructs an adjacency struture with the specified face and corner indices.
void SetVertexStrokeID(unsigned int iVertexIndex, unsigned int iStrokeID) const
Internal use only. Do not call.
Store< unsigned int > m_aTCIs
bool Copy(Store &s) const
Copies the contents of another array into this one, duplicating all data. Returns true if successful...
Vector m_vLocalNormal
the normal vector of the mesh at the picked point, in local space
const Vertex * VertexArray(void) const
This method returns a pointer to the actual array data.
unsigned int & operator[](unsigned int i)
unsigned int VertexStrokeID(unsigned int iVertexIndex) const
Internal use only. Do not call this method.
TangentGenerator is a class that defines the tangent space used by Mesh objects.
const AxisAlignedBoundingBox & GetPartitionAABB(unsigned int pIdx) const
returns the bounding box of a partition.
const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
GLuint GLuint GLsizei count
float m_fData
This variable can be used freely to store a float value for the vertex.
const Vector & QuadVertexPosition(unsigned int iQuadIndex, unsigned int iCornerIndex) const
Returns the position of a corner of a mesh face. Can be used for quadric meshes only.
float VertexMask(unsigned int iVertexIndex) const
Returns the layer mask of the vertex with the given index for the current sculpt layer.
Generic base interface for classes implementing a face based selection.
const TC & QuadVertexTC(unsigned int iQuadIndex, unsigned int iCornerIndex) const
Returns the texture coordinates of a corner of a mesh face. Can be used for quadric meshes only...
unsigned int GetFacePartitionIndex(unsigned int faceID) const
return the index within it's partition partition of a given face ID.
unsigned int m_iVertexCount
This class represents an event receiver/triggerer point.
unsigned int VertexCount(void) const
Returns the number of vertices in the mesh.
DiagnosticLevel
Indicates the level of validity checking that is performed in CheckValidity()
A base class for operations that must be applied across mesh vertices.
unsigned char m_iVertexCorner
The corner within the face that corresponds to the current vertex.
This class represents a change to a mesh, and is used when an operation which modifies mesh vertices ...
QualityHint GetCurrentPartitioningQuality() const
Return the current partitioning quality for this partitioning node.
bool IsVertexMarked(unsigned int iVertexIndex)
Returns true if a particular vertex is marked.
bool operator!=(const QByteArray &a1, const QByteArray &a2)
ScreenSpacePicker objects are used to translate the user action of clicking in the view into a picked...
unsigned int CollectionID(void) const
Obsolete method; do not use.
unsigned int GetPartitionFaceCount(unsigned int pIdx) const
Return the number of faces to enumerate in the specified partition Note some faces may be INVALID_ID ...
unsigned char CornerIndex() const
Returns the corner index of a face which is touching the vertex that corresponds to this structure If...
unsigned int ItemCount(void) const
Returns the number of items in the array.
Represents Texture Coordinates (UVs) in the mesh.
unsigned int m_iVertexIndex
Index of the vertex.
float TriangleVertexFreeze(unsigned int iTriangleIndex, unsigned int iCornerIndex) const
Returns the freeze value of a corner of a mesh face. Can be used for triangular meshes only...
unsigned int & GetRestoreCountRef()
This is not part of the API – do not use. (it is here for performance reasons.)
Represents a camera (point of view) in a Mudbox scene.
void ContentChanged(void) const
This function must be called if the content of the node is changed.
float Data(unsigned int iVertexIndex) const
Returns the float data value stored in the vertex change.
unsigned int m_iID
This variable is used internally.
const TC & VertexTC(unsigned int iVertexTCIndex) const
Returns the specified texture coordinate.
bool IsContaining(const Vector &cV) const
Returns true if the box contains the specified point.
MBDLL_DECL Vector operator*(float f, const Vector &v)
Multiplies a float scalar value by a vector, the result is a vector.
void SetPartitionDirty(unsigned int pIdx)
called by the HWRenderer to set the dirty flag to clean once it has built the VBOs for the specified ...
unsigned int Add(const type &e)
Adds a new item to the array, increasing the array size by 1.
Class: ConvolutionKernel.
This class is the base of all node types that can be structured in a hierarchy.
SurfacePoint(void)
Void Constructor.
unsigned int Adjacency(unsigned int i)
Returns the ith adjacent for the given face.
unsigned int m_iRestoreCount
__forceinline Vector OriginalNormal(unsigned int iVertexIndex) const __attribute__((always_inline))
This function returns the surface normal before the change for a specified vertex.
static void SetFaceMode(bool b=true)
sets a static mode to use either face indices or vertex indices to perform partitioning.
const Vector & VertexPosition(unsigned int iVertexIndex) const
Returns the x,y,z position of the vertex with the given index.
unsigned int GetFaceCount() const
return the count of faces in the partitioning.
unsigned int GetPartitionVersion(unsigned int pIdx) const
Returns the version number of the specified partition.
This object is used to manage the lock on a mesh.
StoredVertexInfo is used to store vertex change information.
GLubyte GLubyte GLubyte a
class Mesh * m_pMesh
the mesh that has been picked
unsigned int TCCount(void) const
Returns the number of texture coordinates in the mesh.
unsigned int GetPartitionID(unsigned int faceID) const
Returns the partition ID given a face ID.
This object is used to manage a roughly spatially coherent partitioning of the mesh.
unsigned int GetPartitionMaxFaceID(unsigned int pIdx) const
Get the maximum face ID in a partition. If empty, return 0.
Describes a material of a geometry including its surface colors, transparency and texture information...
static unsigned int GetDefaultPartitionCount()
Query the default partition count.
bool IsSelected(void) const
Returns the Selected state of the Vertex (true or false)
unsigned int m_iCollectionID
const QPoint operator-(const QPoint &p1, const QPoint &p2)
bool m_bBuildVertexAdjacency
Represents a 3d object in the scene.
float Mask(void) const
Do not use this method.
Streams are used to read information from a file, or to write it to a file.
Vector TriangleVertexNormal(unsigned int iTriangleIndex, unsigned int iCornerIndex) const
Returns the normal of a corner of a mesh face. Can be used for triangular meshes only.
unsigned int TCI(unsigned int i)
Returns the ith TC index for the face.
float m_fRelativeRange
position of a mesh-line intersection relative to the line. Ranges from 0.0 (at the beginning of the l...
#define DECLARE_CLASS
This macro should be used in declaration of classes which are inherited from the Node class (or any d...
void ExpandBy(float f)
Expands the AABB by a specified amount in all directions.
const AxisAlignedBoundingBox & GetTotalAABB() const
get the bounding box of this partitioning.
void SetVertexNormal(unsigned int iVertexIndex, int *pNormal)
Internal use only. Do not call.
const Vertex & VertexData(unsigned int iVertexIndex) const
Returns a vertex.
aevent Modified
This event is triggered when the mesh has been editer. During a sculpt stroke this event is only trig...
tnormalv TriangleVertexNormalValue(unsigned int iTriangleIndex, unsigned int iCornerIndex) const
Returns the normal a corner of a triangle mesh face as a single 64-bit signed value.
unsigned int GetPartitionFace(unsigned int pIdx, unsigned int fIdx) const
Return the specified face id in the specified partition Note some faces may be INVALID_ID – these sh...
unsigned int GetPartitionMinFaceID(unsigned int pIdx) const
Get the minimum face ID in a specified partition. If empty, will return 0xffffffff.
unsigned int GetFacePartition(unsigned int faceID) const
return the Partition id of a specified face. Can be INVALID_ID if it's not in a partition.
This is an interface for a SurfaceSmoother object, which is responsible to provide information about ...
Represents a vertex point on a Mesh with its associated data.
Represents the topology data of a mesh, providing information about the structure of a surface...
unsigned int GetRestoreCount() const
void Serialize(Stream &s)
Serializing.
VertexAdjacency()
Constructs a invalid adjacency structure.
bool IsValid() const
Returns true if this structure is valid, false otherwise.
const tnormal * VertexNormalArray(unsigned int iVertexIndex) const
Returns the normal of the vertex with the given index as an array of 16-bit signed values...
static QualityHint GetDefaultQuality()
Query the default quality hint.
virtual const Vector & VertexOriginalPosition(unsigned int iVertexIndex) const
Returns the position of the vertex before the current sculpting-brush stroke.
This class represents a Sculpt Layer.
bool AnyPartitionsDirty()
returns true if any of the partitions are dirty.
const Vector & TriangleVertexPosition(unsigned int iTriangleIndex, unsigned int iCornerIndex) const
Returns the position of a corner of a mesh face.
static bool IsInFaceMode()
float VertexFreeze(unsigned int iVertexIndex) const
Returns the freeze value of the vertex with the given index.
Vector m_vPosition
The position of the vertex before the change.
unsigned int m_iFaceIndex
the index of the face that has been picked
__forceinline VertexChange & Add(unsigned int iVertexIndex, unsigned int iFaceIndex, bool bPrecalculateLayerIndex=false, float fDataInitialValue=0.0f) __attribute__((always_inline))
Register a vertex for the change, and returns the corresponding VertexChange structure.
class TangentGenerator * m_pTG
address of a tangent generator which should be used to calculate tangents for this surface point ...
Vector QuadVertexCreaseNormal(unsigned int iQuadIndex, unsigned int iCornerIndex) const
Returns the normal of a corner of a mesh face. Can be used for quad meshes only.
unsigned int m_iLayerVertexIndex
Index of the vertex within the current sculpt layer.
unsigned int FaceIndex() const
Returns the face index of a face which is touching the vertex that corresponds to this structure If V...
bool IsCurrentPartitioningFaceBased() const