MapExtractorAPI/MapExtractorAPI.h Source File

MapExtractorAPI.h
Go to the documentation of this file.
1 #ifndef MAPEXTRACTORAPI_H
2 #define MAPEXTRACTORAPI_H
3 
4 #if defined(JAMBUILD)
5 #include <Mudbox/mudbox.h>
7 #else
8 #include "../../include/Mudbox/mudbox.h"
9 #include "../../include/MapExtractor/MapExtractorInterface.h"
10 #endif
11 
12 #ifndef COMPILING_MAPEXTRACTORAPI_DLL
13 #define MEADLL MUDBOX_DLLIMPORT
14 #else
15 #define MEADLL MUDBOX_DLLEXPORT
16 #endif
17 
18 namespace mapextraction
19 {
21  MEADLL class Extractor CreateNewOperation( void );
23  MEADLL int OperationCount( void );
25  MEADLL class Extractor OperationByIndex( int iIndex );
26 
29  {
35  };
36 
39  {
43  locCustom,
47  };
48 
50  enum Space
51  {
58  spaceNormal,
61  };
62 
65  {
73  };
74 
77  {
84  };
85 
87  enum Sampling
88  {
93  };
94 
96  enum Quality
97  {
104  };
105 
108  {
115  };
116 
119  {
123  };
124 
127  {
128  protected:
129  Sampler( void );
130  mudbox::aptr<mapextractionmodules::Sampler> m_pSampler;
131 
132  public:
134  Sampler( mapextractionmodules::Sampler *p ) { m_pSampler = p; };
136  inline bool IsEnabled( void ) const { return m_pSampler->IsEnabled(); };
138  inline void SetEnabled( bool bEnable ) { m_pSampler->SetEnabled( bEnable ); m_pSampler->Extractor()->ValidityChanged(); };
139 
141  enum VertexAction VertexAction( void ) const;
143  void SetVertexAction( enum VertexAction eAction );
145  QString FileName( void ) const;
148  void SetFileName( const QString &sFileName );
150  bool UseTmpFile( void ) const;
152  void SetUseTmpFile( bool bTmp );
154  enum mudbox::Image::Format PixelFormat( void ) const;
156  void SetPixelFormat( enum mudbox::Image::Format eFormat );
158  bool Preview( void ) const;
160  void SetPreview( bool bEnable );
162  Space VertexMoveSpace( void ) const;
164  void SetVertexMoveSpace( Space eSpace );
165  // Returns the multiplier used for vertex based extraction. This is only valid if utilizer type is set to vertex.
166  mudbox::Vector VertexFactor( void ) const;
167  // Sets the multiplier used for vertex based extraction. This is only valid if utilizer type is set to vertex.
168  void SetVertexFactor( const mudbox::Vector &vFactor );
169  // Returns the offset used for vertex based extraction. This is only valid if utilizer type is set to vertex.
170  mudbox::Vector VertexOffset( void ) const;
171  // Sets the offset used for vertex based extraction. This is only valid if utilizer type is set to vertex.
172  void SetVertexOffset( const mudbox::Vector &vOffset );
174  QString LayerNameForVertexAction( void ) const;
176  void SetLayerNameForVertexAction( const QString &sLayerName );
178  bool RedirectToSculptLayer( void ) const;
180  void SetRedirectToSculptLayer( bool bRedirect );
182  mudbox::Layer *ResultLayer( void ) const;
183 
184  friend class Extractor;
185  };
186 
189  {
190  public:
192  bool NormalizeToSearchDistance( void ) const;
194  void SetNormalizeToSearchDistance( bool bNormalize );
195  };
196 
199  {
200  public:
202  enum Space Space( void ) const;
204  void SetSpace( enum Space eSpace );
205  };
206 
208  class MEADLL NormalSampler : public Sampler
209  {
210  public:
212  enum Space Space( void ) const;
214  void SetSpace( enum Space eSpace );
216  bool Smooth( void ) const;
218  void SetSmooth( bool bSmooth );
220  enum Compatibility Compatibility( void ) const;
222  void SetCompatibility( enum Compatibility eCompatibility );
223  };
224 
227  {
228  public:
230  enum Quality Quality( void ) const;
232  void SetQuality( enum Quality eQuality );
234  enum Resolution ShadowMapResolution( void ) const;
236  void SetShadowMapresolution( Resolution eResolution );
238  float ShadowDarkness( void ) const;
240  void SetShadowDarkness( float fDarkness );
242  float ShadowContrast( void ) const;
244  void SetShadowContrast( float fContrast );
246  float Filter( void ) const;
248  void SetFilter( float fFilter );
249  };
250 
253  {
254  public:
265  QString ChannelName( void ) const;
276  void SetChannelName( const QString &sChannelName );
278  int LayerIndex( void ) const;
280  void SetLayerIndex( int iIndex );
282  int LayerInGroupIndex( void ) const;
284  void SetLayerInGroupIndex( int iIndex );
285  };
286 
289  {
290  public:
292  QString Layer( void ) const;
294  void SetLayer( const QString &sLayerName );
295  };
296 
300  {
301  Extractor( void );
302  mudbox::aptr<mapextractionmodules::MapExtractor> m_pMapExtractor;
303  bool m_bOwn;
304  public:
305  Extractor( mapextractionmodules::MapExtractor *pExtractor );
306  ~Extractor( void );
308  mapextractionmodules::MapExtractor *ExtractorObject( void ) { return m_pMapExtractor; };
310  int SourceCount( void ) const;
312  mudbox::SubdivisionLevel *Source( int iIndex ) const;
314  void SetSourceCount( int iCount );
316  void SetSource( int iIndex, mudbox::SubdivisionLevel *pSource );
318  bool SourceSmoothing( void ) const;
320  void SetSourceSmoothing( bool bSourceSmoothing );
321 
323  int TargetCount( void ) const;
325  mudbox::SubdivisionLevel *Target( int iIndex ) const;
327  void SetTargetCount( int iCount );
329  void SetTarget( int iIndex, mudbox::SubdivisionLevel *pTarget );
331  bool TargetSmoothing( void ) const;
333  void SetTargetSmoothing( bool bTargetSmoothing );
335  bool TargetUVSmoothing( void ) const;
337  void SetTargetUVSmoothing( bool bSmoothUV );
339  bool TargetCreases( void ) const;
341  void SetTargetCreases( bool bUse );
342 
345  void SetTangentGenerator( mudbox::TangentGenerator *pTG );
346 
347  // layout
349  enum UtilizerType UtilizerType( void ) const;
351  void SetUtilizerType( enum UtilizerType eUtilizerType );
353  int MapWidth( void ) const;
355  int MapHeight( void ) const;
357  void SetMapWidth( int iWidth );
359  void SetMapHeight( int iHeight );
361  enum Antialiasing Antialiasing( void ) const;
363  void SetAntialiasing( enum Antialiasing eAntialiasing );
365  int EdgeBleeding( void ) const;
368  void SetEdgeBleeding( int iPixels );
369 
370  // samplers
372  class DisplacementSampler DisplacementSampler( int iIndex = 0 );
376  class NormalSampler NormalSampler( int iIndex = 0 );
378  class AmbientOcclusionSampler AmbientOcclusionSampler( int iIndex = 0 );
380  class PaintLayerSampler PaintLayerSampler( int iIndex = 0 );
382  class SculptLayerSampler SculptLayerSampler( int iIndex = 0 );
384  class Sampler DummySampler( int iIndex = 0 );
385 
386  // locate
388  enum LocateMethod LocateMethod( int iIndex = 0 ) const;
390  void SetLocateMethod( enum LocateMethod eLocateMethod, int iIndex = 0 );
392  void SetLocateMeshes( QVector<mudbox::SubdivisionLevel *> aInputs, QVector<mudbox::SubdivisionLevel *> aOutputs, int iIndex = 0 );
394  enum Sampling Sampling( int iIndex = 0 ) const;
396  void SetSampling( enum Sampling, int iIndex = 0 );
399  float SearchDistance( int iIndex = 0 ) const;
402  void SetSearchDistance( float fSearchDistance, int iIndex = 0 );
404  bool TestBothSides( int iIndex = 0 ) const;
406  void SetTestBothSides( bool bBothSides, int iIndex = 0 );
410  bool PickLowestLevel( int iIndex = 0 ) const;
412  void SetPickLowestLevel( bool bPickLowest, int iIndex = 0 );
414  float Tolerance( int iIndex = 0 ) const;
416  void SetTolerance( float fTolerance, int iIndex = 0 );
417 
419  bool Execute( bool bInterface = true );
420 
421  friend MEADLL Extractor CreateNewOperation( void );
422  friend MEADLL Extractor OperationByIndex( int );
423  };
424 };
425 
426 #endif
The vertex position is modified based on the extracted data (the data as a vector is added to the cur...
This class represents the displacement sampler.
This class represents the ambient occlusion sampler.
Space
Coordinate space used in varoius places during extraction.
VertexAction
This is the action which happens with each vertex after extraction. This is only valid if the utilize...
Each vertex gets a new vertex color asigned, based on the calculated data.
Represents a 3D vector or point with S23E8 floating point elements.
Definition: math.h:35
The closest to the target mesh is chosen.
mudbox::aptr< mapextractionmodules::Sampler > m_pSampler
void SetEnabled(bool bEnable)
Turns a sampler on or off. Each sampler is disabled by default. At least one sampler has to be enalbe...
Format
Image channel datatype type.
Definition: image.h:1522
This is the base class for anything which is an element of a list with a fixed order and a transparen...
Definition: layer.h:20
The furthest is chosen, inside the target mesh.
Change the mask for the given sculpt layer based on the extracted data.
This class represents the normal vector sampler.
This class represents the paint layer sampler. This sampler simply samples a paint layer over the sou...
Quality
Quality of ambient occlusion extraction.
Create a new sculpt layer, and put vectors there, without changing the actual vertex positions...
This method can only be used, when there is a precalculated relationship between the source and targe...
Compatibility
Compatibility of the extracted normal map.
MEADLL class Extractor CreateNewOperation(void)
Creates a new extractor node.
This class represents the central module of the extraction.
Extracting data to vertices of the target mesh.
Sampling
How the intersection point is chosen when there are multiple candidates. This is only valid if locate...
Object space, which is always related to some mesh in the scene.
Traditional textures, which are saved as plain image files (jpg, png, etc..), one for each tile...
TangentGenerator is a class that defines the tangent space used by Mesh objects.
Definition: mesh.h:1149
This class represents the sculpt layer sampler. This sampler samples a sculpt layer at the given poin...
This is a special space, which is changing over the mesh, so it also depends on a location...
This is a special space used in displacement map extraction. Used only internally.
Change the vertex freeze value based on the extracted data.
With this method, mudbox fires a ray which crosses the target mesh in the desired point...
Move the vertex along the surface normal.
LocateMethod
This is the method Mudbox uses to pair sourface points on the target mesh to surface points on the so...
bool IsEnabled(void) const
Returns true, if the sampler is enabled. Only enabled samplers are used during extraction.
Extracting to a ptex file.
The furthest is chosen, outside of the target mesh.
Antialiasing
Type of the antialiasing applied to extracted textures. This is only valid if utilizer type is set to...
GLfloat GLfloat p
Definition: GLee.h:5416
Sampler(mapextractionmodules::Sampler *p)
Create a sampler class for an existing sampler module.
World space (or global space).
Same as above, but the tangent and bitangent remains unnormalized and their direction is not aligned ...
MEADLL int OperationCount(void)
Returns the number of extractor nodes in the scene.
#define MEADLL
Represents one level of subdivision details in a geometry.
Definition: subdivision.h:40
This method can only be used, if the target mesh and the source mesh are subdivision levels of the sa...
This sampler represents the vector displacement sampler.
This is a base class for a sampler node, which can generate some data for a given target-source surfa...
This class represents a sampler in map extraction, like Displacement, Ambient occlusion, etc...
mapextractionmodules::MapExtractor * ExtractorObject(void)
Returns a pointer to the underlying map extractor object.
This is the cental modul for map extraction, this node controls the map extraction process by communi...
Resolution
Resolution of a texture map. This is always square.
UtilizerType
This is the type of the final result for map extaction. This controls where the reference points are ...
MEADLL class Extractor OperationByIndex(int iIndex)
Returns a given existing extractor node.