Mudbox/viewport.h Source File

viewport.h
Go to the documentation of this file.
1 
2 //**************************************************************************/
3 // Copyright (c) 2008 Autodesk, Inc.
4 // All rights reserved.
5 //
6 // Use of this software is subject to the terms of the Autodesk license
7 // agreement provided at the time of installation or download, or which
8 // otherwise accompanies this software in either electronic or hard copy form.
9 //
10 //**************************************************************************/
11 // DESCRIPTION:
12 // CREATED: October 2008
13 //**************************************************************************/
14 
15 namespace mudbox {
16 
17 class ViewPortFilter;
18 
21 {
29 };
30 
38 {
40 public:
41 
46  typedef int RequirementValue;
47  enum
48  {
49  eNone = 0,
50  eColor = 1,
51  eHDR = 2,
52  eDepth24 = 4,
53 // ePosition16 = 8, // not implemented
54  eNormal16 = 16,
55  ePosition32 = 32,
56 // eNormal32 = 64, // not implemented
57  eNormalDepth16 = 128,
58 // eNormalDepth32 = 256, // not implemented
59  eLinearDepth = 512,
60  eFaceNormal = 1024,
61  };
62 
64  virtual QString StringID( const ClassDesc *pClass = 0 ) const;
65 
67  virtual QString DisplayName( void ) const;
68 
70  virtual void Initialize(void);
71 
78  virtual RequirementValue Requirement( void ) const;
79 
87  virtual void Process(
88  ViewPortState &sState
89  );
90 
92  virtual float Transparency( void ) const;
93 
95  virtual void SetTransparency(float fTransparency);
96 
98  virtual Layer *Children( void ) const;
99 
101  virtual Layer *Next( void ) const;
102 
104  virtual Layer *Prev( void ) const;
105 
107  virtual class LayerContainer *Container( void ) const;
108 
110  void SetVisible(
111  bool bVisible
112  );
113 
128  virtual void LockCalibration(
129  bool bLock
130  );
131 
133  bool CalibrationLocked(void);
134 
137 
138 protected:
140 };
141 
142 
148 {
150 
151 protected:
160  ViewPort( void );
161 public:
162 
164  virtual unsigned int FilterCount( void ) const;
165 
167  virtual ViewPortFilter *Filter(
168  unsigned int iIndex
169  ) const;
170 
172  virtual void AddFilter(
173  ViewPortFilter *pFilter
174  );
175 
177  virtual void RemoveFilter(
178  unsigned int iIndex
179  );
180 
182  void LockFilterCalibration(
183  bool bLocked
184  );
185 
192  virtual void SaveScreenshot(
193  const QString &sFileName
194  ) const;
195 
197  virtual int Width( void );
198 
200  virtual int Height( void );
201 
203  class ImagePlaneInterface *ActiveImagePlane();
204 
206  virtual float CursorXPosition( void ) const;
207 
209  virtual float CursorYPosition( void ) const;
210 
212  const SurfacePoint *CursorSurfacePoint(
213  bool bMirrored = false
214  ) const;
215 
217  unsigned int LayerCount( void ) const;
218 
220  class Layer *Layer(
221  unsigned int iLayerIndex
222  ) const;
223 
225  void UnlinkLayer(
226  class Layer *pLayer
227  );
228 
230  class Layer *CreateLayer( void );
231 
233  void AddLayer(
234  class Layer *pLayer
235  );
236 
238  class Layer *ActiveLayer( void ) const;
239 
241  void SetActiveLayer(
242  class Layer *pLayer
243  );
244 
246  ViewPortFilter::RequirementValue ViewPortFilterRequirements( void ) const;
247 
250  {
253  eOverlayOnly
254  };
255 
257  void Redraw(
258  RedrawType eType = eFull,
259  float fXStart = 0,
260  float fYStart = 0,
261  float fXEnd = 0,
262  float fYEnd = 0
263  );
264 
267  srmNormal = 0,
271  srmNoTextures
272  };
273 
288  Image *RenderScene(
289  const QString &sChannel,
290  int iWidth,
291  int iHeight,
292  SceneRenderMode renderMode,
293  enum Image::Format fmt = Image::e8integer,
294  bool bTiledImg = true
295  );
296 
311  Image *RenderScene(
312  int iWidth,
313  int iHeight,
314  SceneRenderMode renderMode,
315  enum Image::Format fmt = Image::e8integer,
316  bool bTiledImg = true
317  );
318 
330  Image *RenderScene(
331  int iWidth,
332  int iHeight,
333  enum Image::Format fmt = Image::e8integer,
334  bool bTiledImg = true
335  ) const;
336 
339  mppOff = 0,
345  mppLocalZ
346  };
347 
350  mdpOff = 0,
352  mdpToNegative
353  };
354 
362  void SetMirrorPlanePreview(
363  MirrorPlanePreviewMode newMode,
364  float offset = 0.0
365  );
366 
368  MirrorPlanePreviewMode MirrorPlanePreview( void ) const;
369 
371  float MirrorPlanePreviewOffset( void ) const;
372 
374  void SetMirrorDirectionPreview( MirrorDirectionPreviewMode newMode );
375 
377  MirrorDirectionPreviewMode MirrorDirectionPreview( void ) const;
378 
380  virtual struct ViewPortState ViewPortState( void );
381 
383  virtual bool ShowCurves( void ) const;
384 
387 
390 
393 
397 
400 
403 
406 
409 
413 
416 
417 protected:
418  virtual Image* RenderRegion( ImgTile bounds, ImgTile region, enum Image::Format eFormat, bool bTiled ) const;
419 };
420 
421 }; // end of namespace mudbox
GLintptr offset
Definition: GLee.h:1562
MirrorPlanePreviewMode
Describes possible states for the Mirror Plane Preview.
Definition: viewport.h:338
static aevent ContextMenuEvent
This event is triggered on context menu (right mouse button)
Definition: viewport.h:408
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
int RequirementValue
The RequirementValue typedef is used to tell Mudbox what information needs to be calculated at render...
Definition: viewport.h:46
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
RedrawType
This type controls the behaviour of the Redraw function, used as a parameter there.
Definition: viewport.h:249
Describes a location somewhere on the surface of a Mesh.
Definition: mesh.h:340
SceneRenderMode
Describes how to render the scene off-screen with RenderScene.
Definition: viewport.h:266
flat shaded, no textures, grids, curves or background
Definition: viewport.h:270
Texture * m_pColor
Definition: viewport.h:22
Holds all the information about the current viewport state, used by ViewPortFilter objects...
Definition: viewport.h:20
static aevent MouseMoveEvent
This event is triggered when a mouse move event occurs inside the viewport.
Definition: viewport.h:399
Texture * m_pFaceNormal
Definition: viewport.h:27
flat shaded, textures on white material background, no grids, curves or background ...
Definition: viewport.h:269
static aevent LeftMouseButtonPressEvent
This event is triggered when left mouse button down occurs.
Definition: viewport.h:402
Texture * m_pLinearDepth
Definition: viewport.h:26
Texture * m_pNormal
Definition: viewport.h:25
This structure represents and describes a class.
Definition: node.h:22
static aevent EndRenderEvent
This event is triggered when rendering a new image of the scene is finished. See the class EventGate ...
Definition: viewport.h:392
This class represents an event receiver/triggerer point.
Definition: node.h:999
static aevent ViewportResizeEvent
This event is triggered when viewport's size is changed.
Definition: viewport.h:415
static aevent LeftMouseButtonReleaseEvent
This event is triggered when left mouse button release occurs.
Definition: viewport.h:405
static aevent FrameEvent
This event is triggered when a new frame is displayed on the viewport. See the class EventGate for mo...
Definition: viewport.h:389
Texture * m_pDepth
Definition: viewport.h:23
Represents a texture tile inside a texture pool.
Definition: material.h:716
static aevent PostRenderEvent
This event is triggered at the end of rendering the scene into a rendertarget.
Definition: viewport.h:396
Class: ConvolutionKernel.
Definition: array.h:15
Schedule a full redraw of the 3d viewport later, ViewPort::Redraw returns immediately when this param...
Definition: viewport.h:252
This class contains and manages a list of Layers.
Definition: layer.h:47
Represents a rectangle. Used to specify rectangular regions of an image.
Definition: image.h:960
static aevent PreRenderEvent
This event is triggered when a new frame is about to be drawn.
Definition: viewport.h:386
static aevent SceneRenderEvent
This event is triggered after scene is rendered.
Definition: viewport.h:412
flat shaded, textures on black material background, no grids, curves or background ...
Definition: viewport.h:268
#define DECLARE_CLASS
This macro should be used in declaration of classes which are inherited from the Node class (or any d...
Definition: node.h:91
Texture * m_pPosition
Definition: viewport.h:24
MirrorDirectionPreviewMode
Describes possible states for the Mirror Direction Preview.
Definition: viewport.h:349
ViewPortFilters are post-processes that are applied to the rendered scene before display.
Definition: viewport.h:37
This is the base image type defining the interface to images.
Definition: image.h:1504
class ViewPort * m_pViewPort
A pointer to the Viewport containing this ViewPortFilter.
Definition: viewport.h:136
#define MBDLL_DECL
Definition: dllinterface.h:35
Represents the 3D viewport where Mudbox renders the scene.
Definition: viewport.h:147