TargetLocation Class Reference

TargetLocation Class Reference

#include <MapExtractorInterface.h>

Class Description

This class holds information about a reference point on the target mesh.

This class contains all the information which normally contained by a SurfacePoint class, but it extends it with some more. This class is filled by the layout node when it finds a reference point on the target mesh and would like the map extractor node to process this location, i.e. find the related source point, and calculate data values for it.

+ Examples:

Definition at line 506 of file MapExtractorInterface.h.

+ Inheritance diagram for TargetLocation:

Public Types

enum  Flags { flagMirrorX = 1, flagMirrorY = 2, flagMirrorZ = 4, flagLocalMirror = 8 }
 

Public Member Functions

 TargetLocation (void)
 
 TargetLocation (class mudbox::Mesh *pMesh, unsigned int iVertexIndex, unsigned int iFaceIndex)
 
void Fill (class mudbox::Mesh *pMesh, unsigned int iFaceIndex, float fFaceU, float fFaceV, float fDiameter=1.0f)
 Fill the structure with raw data. More...
 
void FillUsingUV (class mudbox::Mesh *pMesh, unsigned int iFaceIndex, float fU, float fV, mudbox::SurfaceSmoother *pSS=NULL, float fDiameter=1.0f)
 This function fills the structure base on UV values. More...
 
void FillNSided (class mudbox::Mesh *pMesh, unsigned int iFaceIndex, const mudbox::Vector &vPosition, float fDiameter=1.0f)
 This function fills the structure with a point on a polygon with arbitrary number of corners. More...
 
void AddFlag (Flags eFlagToAdd) const
 This function adds a new flag to the current ones (OR operation). More...
 
void CalculateSmoothData (const MapExtractor *)
 
mudbox::Base TangentBase (void) const
 
- Public Member Functions inherited from SurfacePoint
 SurfacePoint (void)
 Void Constructor. More...
 
 SurfacePoint (class Mesh *pMesh, unsigned int iVertexIndex, unsigned int iFaceIndex)
 Constructor. More...
 
class MeshMesh (void) const
 Returns the mesh on which the point is. More...
 
unsigned int FaceIndex (void) const
 Returns the index of the face which contains the surface point. More...
 
Vector LocalPosition (void) const
 Returns the position of the SurfacePoint in local space. More...
 
Vector WorldPosition (void) const
 Returns the position of the SurfacePoint in world space. More...
 
Vector LocalNormal (void) const
 Returns the normal of the selected face in local space. More...
 
Vector WorldNormal (void) const
 Returns the normal of the selected face in world space. More...
 
TC TextureCoordinate (void) const
 Returns the texture coordinate of the surface point. More...
 
Base TangentBase (void) const
 Returns the tangent base at the surface point in local space. More...
 
Vector FaceCoordinates (void) const
 Returns a 2d vector indicating the position of the selected point within its face. More...
 
bool Fill (class Mesh *pMesh, unsigned int iFaceIndex, const Vector &vStart, const Vector &vEnd, bool bTwoSide=false, bool bOriginalPosition=false)
 Set the SurfacePoint values based on a line in local space. More...
 
void Fill (class Mesh *pMesh, unsigned int iFaceIndex, float fFaceU, float fFaceV)
 Set the SurfacePoint values based on a given point inside a face. More...
 
void Fill (class Mesh *pMesh, unsigned int iFaceIndex, const Vector &vLocalPosition, bool bRecalculatePosition)
 Set the SurfacePoint values based on the 3D position of a point in a face. More...
 
void SetTangentGenerator (TangentGenerator *pGenerator)
 This function overrides the default tangent generator for the surface point. More...
 
void Align (void)
 The following function aligns the face coordinates to be in the range 0-1. More...
 
void Mirror (void)
 This function mirrors the surface point to the other side of the mesh using topological symmetry (if initialized) More...
 
void Serialize (Stream &s)
 Serialize the SurfacePoint to the given stream. More...
 

Public Attributes

float m_fDiameter
 This data member is an approximation of the influence area on the target mesh, i.e. More...
 
int m_aLayoutData [16]
 This data member is a general area, where the layout can store some information about the reference point, which later will be used by the utilizer class. More...
 
unsigned int m_iReferenceFaceIndex
 Sometimes it is necessary to use two different locations on the target mesh, one as a reference point, and one for the rest of the calculation. More...
 
float m_fReferenceFaceU
 Sometimes it is necessary to use two different locations on the target mesh, one as a reference point, and one for the rest of the calculation. More...
 
float m_fReferenceFaceV
 
unsigned int m_iIndex
 Index of the target location in the queue. More...
 
unsigned int m_iFlags
 These flags are used to indicate special properties of the target location. More...
 
mudbox::Base m_bTangent
 
- Public Attributes inherited from SurfacePoint
class Meshm_pMesh
 the mesh that has been picked More...
 
unsigned int m_iFaceIndex
 the index of the face that has been picked More...
 
float m_fRelativeRange
 position of a mesh-line intersection relative to the line. Ranges from 0.0 (at the beginning of the line) to 1.0 (at the end). More...
 
Vector m_vLocalPosition
 position of the point in local space More...
 
Vector m_vLocalNormal
 the normal vector of the mesh at the picked point, in local space More...
 
bool m_bSide
 if true, the backside of the face was selected. (This is not supported; use at your own risk.) More...
 
class TangentGeneratorm_pTG
 address of a tangent generator which should be used to calculate tangents for this surface point More...
 
Vector m_vFaceCoordinates
 

Member Enumeration Documentation

Constructor & Destructor Documentation

TargetLocation ( void  )
inline

Definition at line 541 of file MapExtractorInterface.h.

541 : m_fDiameter( 1.0f ), m_iReferenceFaceIndex( 0xffffffff ), m_fReferenceFaceU(0), m_fReferenceFaceV(0), m_iIndex(0xffffffff), m_iFlags( 0 ) {};
unsigned int m_iIndex
Index of the target location in the queue.
float m_fDiameter
This data member is an approximation of the influence area on the target mesh, i.e.
unsigned int m_iFlags
These flags are used to indicate special properties of the target location.
float m_fReferenceFaceU
Sometimes it is necessary to use two different locations on the target mesh, one as a reference point...
unsigned int m_iReferenceFaceIndex
Sometimes it is necessary to use two different locations on the target mesh, one as a reference point...
GLclampf f
Definition: GLee.h:9303
TargetLocation ( class mudbox::Mesh pMesh,
unsigned int  iVertexIndex,
unsigned int  iFaceIndex 
)
inline

Definition at line 542 of file MapExtractorInterface.h.

542  :
543  SurfacePoint( pMesh, iVertexIndex, iFaceIndex ), m_fDiameter( 1.0f ), m_iReferenceFaceIndex( 0xffffffff ),
544  m_fReferenceFaceU(0), m_fReferenceFaceV(0), m_iIndex(0xffffffff), m_iFlags( 0 ) {};
unsigned int m_iIndex
Index of the target location in the queue.
float m_fDiameter
This data member is an approximation of the influence area on the target mesh, i.e.
unsigned int m_iFlags
These flags are used to indicate special properties of the target location.
SurfacePoint(void)
Void Constructor.
Definition: mesh.h:351
float m_fReferenceFaceU
Sometimes it is necessary to use two different locations on the target mesh, one as a reference point...
unsigned int m_iReferenceFaceIndex
Sometimes it is necessary to use two different locations on the target mesh, one as a reference point...
GLclampf f
Definition: GLee.h:9303

Member Function Documentation

void Fill ( class mudbox::Mesh pMesh,
unsigned int  iFaceIndex,
float  fFaceU,
float  fFaceV,
float  fDiameter = 1.0f 
)

Fill the structure with raw data.

Parameters
[in]pMeshPointer to the mesh object. This cannot be NULL.
[in]iFaceIndexIndex of the face on the surface which contains the surface point.
[in]fFaceUHorizontal coordinate of the point inside the current face. This must be between 0 and 1.
[in]fFaceVHorizontal coordinate of the point inside the current face. This must be between 0 and 1.
[in]fDiameterDiameter of the area which is represented by the reference point. This is an approximation in most cases.
void FillUsingUV ( class mudbox::Mesh pMesh,
unsigned int  iFaceIndex,
float  fU,
float  fV,
mudbox::SurfaceSmoother pSS = NULL,
float  fDiameter = 1.0f 
)

This function fills the structure base on UV values.

When the layout has the UV value of the point it wants to process, it can use this function to fill the TargetLocation structure.

Parameters
[in]pMeshAddress of the mesh.
[in]iFaceIndexIndex of a face which probably contains the given UV values. The function might refine this index and use a different one.
[in]fUU texture coordinate of the point.
[in]fVV texture coordinate of the point.
[in]pSSAddress of a SurfaceSmoother node if the function should work based on smoothed texture coordinates, NULL otherwise.
[in]fDiameterDiameter of the area this location represents, in world space.
void FillNSided ( class mudbox::Mesh pMesh,
unsigned int  iFaceIndex,
const mudbox::Vector vPosition,
float  fDiameter = 1.0f 
)

This function fills the structure with a point on a polygon with arbitrary number of corners.

This function can be used on meshes with nsided polygons where n is an arbitrary number.

Parameters
[in]pMeshAddress of a triangular mesh representing an nsided surface.
[in]iFaceIndexIndex of the first triangle which belongs to the polygon.
[in]vPositionCoordinate of the point in object space.
[in]fDiameterDiameter of the area this location represents, in world space.
void AddFlag ( Flags  eFlagToAdd) const
inline

This function adds a new flag to the current ones (OR operation).

This is not really a const function, since it is modifying the structure, but functions are allowed to add a new flag even if they are not allowed to modify the content of the object otherwise.

Definition at line 578 of file MapExtractorInterface.h.

578 { m_iFlags |= eFlagToAdd; };
unsigned int m_iFlags
These flags are used to indicate special properties of the target location.
void CalculateSmoothData ( const MapExtractor )
mudbox::Base TangentBase ( void  ) const
inline

Definition at line 581 of file MapExtractorInterface.h.

Member Data Documentation

float m_fDiameter

This data member is an approximation of the influence area on the target mesh, i.e.

the size of the "patch" on the surface which need the data to be calculated for. This data is used for example by the paint layer sampler to decide how big area to use on the source texture to filter the final color.

Definition at line 520 of file MapExtractorInterface.h.

int m_aLayoutData[16]

This data member is a general area, where the layout can store some information about the reference point, which later will be used by the utilizer class.

For example in traditional texture map extraction the layout can store the coordinates of the texel on the texture, so that the utilizer know where to put the color on the image what represents the texture.

Definition at line 524 of file MapExtractorInterface.h.

unsigned int m_iReferenceFaceIndex

Sometimes it is necessary to use two different locations on the target mesh, one as a reference point, and one for the rest of the calculation.

The reference location is used by the normal map sampler to calculate the current tangents. This is used for edge bleeding. This data member must hold the index of the reference face, which is the same as the usual face index in most cases.

Definition at line 528 of file MapExtractorInterface.h.

float m_fReferenceFaceU

Sometimes it is necessary to use two different locations on the target mesh, one as a reference point, and one for the rest of the calculation.

The reference location is used by the normal map sampler to calculate the current tangents. This is used for edge bleeding. These member variables are holding the face coordinates of the reference point, and are the same as the regular face coordinates in most cases.

Definition at line 532 of file MapExtractorInterface.h.

float m_fReferenceFaceV

Definition at line 532 of file MapExtractorInterface.h.

unsigned int m_iIndex

Index of the target location in the queue.

This member variable can be used by the sampler to see which target-location pair is the current one, if it precalculated the data in a phase event before. This member variable is filled by the map extractor node, the layout node can leave it uninitialized.

Definition at line 536 of file MapExtractorInterface.h.

unsigned int m_iFlags
mutable

These flags are used to indicate special properties of the target location.

Definition at line 538 of file MapExtractorInterface.h.

mudbox::Base m_bTangent

Definition at line 539 of file MapExtractorInterface.h.


The documentation for this class was generated from the following file: