HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MSS_SingleOpBaseState.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: MSS_SingleOpBaseState.h
7  *
8  * COMMENTS:
9  * Parent class for SOP custom states.
10  *
11  */
12 
13 #ifndef __MSS_SingleOpBaseState_H__
14 #define __MSS_SingleOpBaseState_H__
15 
16 #include "MSS_API.h"
17 #include <BM/BM_SingleOpState.h>
18 
19 class DM_Workbench;
20 class OP3D_View;
21 class JEDI_View;
22 
23 /// Parent class for SOP custom states.
25 {
26 public:
27  MSS_SingleOpBaseState(JEDI_View &view, PI_StateTemplate &templ,
28  BM_SceneManager *scene,
29  const char *cursor = BM_DEFAULT_CURSOR);
30  virtual ~MSS_SingleOpBaseState(void);
31 
32  virtual const char *className() const;
33 
34 protected:
35  virtual const char *getPresetTypeName() const { return "MSS"; }
36 
37  /// Provide the node to work with. The criteria for which node to use will
38  /// be specific to each network type. This method does NOT overwrite
39  /// the myOpNode pointer.
40  virtual OP_Node *getChosenOp(void) const;
41 
42  /// Set the flags (display/current) of the given node:
43  virtual void setNodeFlags(OP_Node &node);
44 
45  /// Respond to keyboard events
46  virtual int handleKeyTypeEvent(UI_Event *event, BM_Viewport &);
47 
48  // This depends on the secure selection button and
49  // whether a selector is active.
50  virtual bool isSelecting() const;
51  virtual bool needSelectMask() const { return true; }
52 
53  /// Map viewport coordinates to worldspace location and direction
54  void mapToWorld(float x, float y,
55  UT_Vector3 &dir, UT_Vector3 &rayorig);
56 
57  /// Get worldspace to cameraspace transform
58  void getViewportTransform(UT_Matrix4 &xform);
59 
60  /// Get cameraspace to worldspace transform
61  void getViewportItransform(UT_Matrix4 &xform);
62 
63  /// Get the projection transform
64  void getViewportProjectionTransform(
65  UT_Matrix4 &xform) const;
66  /// Get the projection parameters. @see UT_Matrix4::perspective()
67  bool getViewportProjection(
68  fpreal &focal_length,
69  fpreal &horizontal_aperture,
70  bool &is_ortho,
71  fpreal &ortho_width,
72  fpreal &aspect_ratio,
73  fpreal &near_plane,
74  fpreal &far_plane
75  ) const;
76 
77  /// Get level of detail for the viewport
78  float getViewportLOD() const;
79 
80  /// Set the status bar text
81  void showPrompt(const char *msg);
82 
83  JEDI_View &viewer() { return (JEDI_View &)baseViewer(); }
84  const JEDI_View &viewer() const { return (JEDI_View &)baseViewer(); }
85 
86  DM_Workbench &workbench()
87  { return (DM_Workbench &)sceneManager(); }
88  const DM_Workbench &workbench() const
89  { return (DM_Workbench &)sceneManager(); }
90 
91 private:
92 };
93 
94 #endif
BM_SceneManager & sceneManager(void)
GLint y
Definition: glcorearb.h:102
3D Vector class.
#define MSS_API
Definition: MSS_API.h:10
virtual int handleKeyTypeEvent(UI_Event *event, BM_Viewport &viewport)
struct _cl_event * event
Definition: glcorearb.h:2960
virtual const char * className() const
#define BM_DEFAULT_CURSOR
Definition: BM_OpState.h:35
const DM_Workbench & workbench() const
Parent class for SOP custom states.
double fpreal
Definition: SYS_Types.h:263
virtual bool needSelectMask() const
virtual OP_Node * getChosenOp(void) const =0
GLint GLenum GLint x
Definition: glcorearb.h:408
BM_OpView & baseViewer()
Definition: BM_OpState.h:77
virtual void setNodeFlags(OP_Node &node)
const JEDI_View & viewer() const
virtual const char * getPresetTypeName() const