HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_GeometryViewport.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  * COMMENTS:
7  */
8 
9 #ifndef __HOM_GeometryViewport_h__
10 #define __HOM_GeometryViewport_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_Module.h"
16 #include "HOM_ObjNode.h"
17 #include "HOM_EnumValue.h"
18 
21 class HOM_Vector2;
22 
23 SWIGOUT(%rename(GeometryViewport) HOM_GeometryViewport;)
24 
26 {
27 public:
29  { HOM_CONSTRUCT_OBJECT(this) }
31  { HOM_CONSTRUCT_OBJECT(this) }
33  { HOM_DESTRUCT_OBJECT(this) }
34 
35  virtual std::string __repr__() = 0;
36 
37  virtual HOM_EnumValue& type() = 0;
38  virtual void changeType(HOM_EnumValue &type) = 0;
39 
40  SWIGOUT(%newobject settings;)
41  virtual HOM_GeometryViewportSettings *settings() = 0;
42 
43  virtual std::string name() = 0;
44  virtual void changeName(std::string &name) = 0;
45 
46  virtual void home() = 0;
47 
48  virtual void homeAll() = 0;
49  virtual void homeSelected() = 0;
50  virtual void homeGrid() = 0;
51  virtual void homeNonTemplated() = 0;
52 
53  virtual void frameAll() = 0;
54  virtual void frameBoundingBox(HOM_BoundingBox *bbox = NULL) = 0;
55  virtual void frameSelected() = 0;
56  virtual void frameGrid() = 0;
57  virtual void frameNonTemplated() = 0;
58 
59  virtual void draw() = 0;
60 
61  SWIGOUT(%newobject viewTransform;)
62  virtual HOM_Matrix4 *viewTransform() = 0;
63 
64  SWIGOUT(%newobject viewPivot;)
65  virtual HOM_Vector3 *viewPivot() = 0;
66 
67  virtual std::vector<int> resolutionInPixels() = 0;
68 
69  SWIGOUT(%newobject camera;)
70  virtual HOM_ObjNode *camera() = 0;
71  virtual void setCamera(HOM_ObjNode &camera_node) = 0;
72  virtual void setCamera(const char *camera_path) = 0;
73  virtual void saveViewToCamera(HOM_ObjNode &camera_node) = 0;
74 
75  SWIGOUT(%newobject defaultCamera;)
76  virtual HOM_GeometryViewportCamera *defaultCamera() =0;
77  virtual void setDefaultCamera(HOM_GeometryViewportCamera *cam_settings) =0;
78  virtual void useDefaultCamera() =0;
79 
80  virtual bool isCameraLockedToView() = 0;
81  virtual void lockCameraToView(bool) = 0;
82 
83  SWIGOUT(%newobject queryNodeAtPixel;)
84  virtual HOM_Node *queryNodeAtPixel(int x, int y) = 0;
85  SWIGOUT(%newobject queryPrimAtPixel;)
86  virtual HOM_Prim *queryPrimAtPixel(HOM_Node *node, int x, int y) = 0;
87 
88  SWIGOUT(%newobject queryInspectedGeometry;)
89  virtual HOM_Geometry *queryInspectedGeometry() = 0;
90  SWIGOUT(%newobject queryInspectedPrim;)
91  virtual HOM_Prim *queryInspectedPrim() = 0;
92 
93  virtual std::pair<HOM_ElemPtr<HOM_Vector3>, HOM_ElemPtr<HOM_Vector3> >
94  mapToWorld(double x, double y) = 0;
95 
96  virtual HOM_Vector2 *mapToScreen(const HOM_Vector3 &pos) = 0;
97 
98  virtual std::pair<int, int> mapFromMouseChop(double x, double y) = 0;
99 
100  SWIGOUT(%ignore addOpaqueEventCallback;)
101  virtual void addOpaqueEventCallback(void *callback) = 0;
102  SWIGOUT(%ignore removeOpaqueEventCallback;)
103  virtual void removeOpaqueEventCallback(void *callback) = 0;
104  SWIGOUT(%ignore opaqueEventCallbacks;)
105  virtual std::vector<void *> opaqueEventCallbacks() = 0;
106  SWIGOUT(%ignore clearOpaqueEventCallbacks;)
107  virtual void clearOpaqueEventCallbacks() = 0;
108 
109 #ifdef SWIG
110 // expose the handling of the viewport callbacks to HOM
111 %extend
112 {
113  void addEventCallback(InterpreterObject callback)
114  {
115  self->addOpaqueEventCallback(callback);
116  }
117 
118  void removeEventCallback(InterpreterObject callback)
119  {
120  self->removeOpaqueEventCallback(callback);
121  }
122 
123  void clearEventCallbacks()
124  {
125  self->clearOpaqueEventCallbacks();
126  }
127 
128  std::vector<InterpreterObject> eventCallbacks()
129  {
130  std::vector<void *> opaque_callbacks(self->opaqueEventCallbacks());
131 
132  std::vector<InterpreterObject> callbacks;
133  for (int i = 0; i< opaque_callbacks.size(); ++i)
134  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
135  return callbacks;
136  }
137 }
138 #endif
139 
140 };
141 
142 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1053
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
GLint y
Definition: glcorearb.h:102
png_uint_32 i
Definition: png.h:2877
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1052
GLuint const GLchar * name
Definition: glcorearb.h:785
GLint GLenum GLint x
Definition: glcorearb.h:408
HOM_GeometryViewport(const HOM_GeometryViewport &)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107