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 #include <UT/UT_Tuple.h>
19 
22 class HOM_Vector2;
23 
24 SWIGOUT(%rename(GeometryViewport) HOM_GeometryViewport;)
25 
27 {
28 public:
30  { HOM_CONSTRUCT_OBJECT(this) }
32  { HOM_CONSTRUCT_OBJECT(this) }
34  { HOM_DESTRUCT_OBJECT(this) }
35 
36  virtual std::string __repr__() = 0;
37 
38  SWIGOUT(%warnfilter(321) type;)
39  virtual HOM_EnumValue& type() = 0;
40  virtual void changeType(HOM_EnumValue &type) = 0;
41 
42  SWIGOUT(%newobject settings;)
43  virtual HOM_GeometryViewportSettings *settings() = 0;
44 
45  virtual std::string name() = 0;
46  virtual void changeName(std::string &name) = 0;
47 
48  virtual void home() = 0;
49 
50  virtual void homeAll() = 0;
51  virtual void homeSelected() = 0;
52  virtual void homeGrid() = 0;
53  virtual void homeNonTemplated() = 0;
54  virtual void homeBoundingBox(HOM_BoundingBox *bbox, bool center_to_origin = false) = 0;
55 
56  virtual void frameAll() = 0;
57  virtual void frameBoundingBox(HOM_BoundingBox *bbox = NULL) = 0;
58  virtual void frameSelected() = 0;
59  virtual void frameGrid() = 0;
60  virtual void frameNonTemplated() = 0;
61 
62  virtual void draw() = 0;
63 
64  SWIGOUT(%newobject viewTransform;)
65  virtual HOM_Matrix4 *viewTransform() = 0;
66 
67  SWIGOUT(%newobject modelToGeometryTransform;)
68  virtual HOM_Matrix4 *modelToGeometryTransform() = 0;
69  SWIGOUT(%newobject cameraToModelTransform;)
70  virtual HOM_Matrix4 *cameraToModelTransform() = 0;
71  SWIGOUT(%newobject ndcToCameraTransform;)
72  virtual HOM_Matrix4 *ndcToCameraTransform() = 0;
73  SWIGOUT(%newobject viewportToNDCTransform;)
74  virtual HOM_Matrix4 *viewportToNDCTransform() = 0;
75  SWIGOUT(%newobject windowToViewportTransform;)
76  virtual HOM_Matrix4 *windowToViewportTransform() = 0;
77 
78  SWIGOUT(%newobject viewPivot;)
79  virtual HOM_Vector3 *viewPivot() = 0;
80 
81  virtual std::vector<int> resolutionInPixels() = 0;
82 
83  SWIGOUT(%newobject camera;)
84  virtual HOM_ObjNode *camera() = 0;
85  virtual void setCamera(HOM_ObjNode &camera_node) = 0;
86  virtual void setCamera(const char *camera_path) = 0;
87  virtual void saveViewToCamera(HOM_ObjNode &camera_node) = 0;
88 
89  SWIGOUT(%newobject defaultCamera;)
90  virtual HOM_GeometryViewportCamera *defaultCamera() =0;
91  virtual void setDefaultCamera(HOM_GeometryViewportCamera *cam_settings) =0;
92  virtual void useDefaultCamera() =0;
93 
94  virtual bool isCameraLockedToView() = 0;
95  virtual void lockCameraToView(bool) = 0;
96 
97  virtual bool isActive2D() = 0;
98  virtual bool isActive3D() = 0;
99 
100  virtual bool usesConstructionPlane() = 0;
101 
102  SWIGOUT(%newobject queryNodeAtPixel;)
103  virtual HOM_Node *queryNodeAtPixel(int x, int y) = 0;
104  SWIGOUT(%newobject queryPrimAtPixel;)
105  virtual HOM_Prim *queryPrimAtPixel(HOM_Node *node, int x, int y) = 0;
106 
107  SWIGOUT(%newobject queryInspectedGeometry;)
108  virtual HOM_Geometry *queryInspectedGeometry() = 0;
109  SWIGOUT(%newobject queryInspectedPrim;)
110  virtual HOM_Prim *queryInspectedPrim() = 0;
111 
112  virtual std::pair<HOM_ElemPtr<HOM_Vector3>, HOM_ElemPtr<HOM_Vector3> >
113  mapToWorld(double x, double y) = 0;
114 
115  virtual HOM_Vector2 *mapToScreen(const HOM_Vector3 &pos) = 0;
116 
117  virtual std::pair<int, int> mapFromMouseChop(double x, double y) = 0;
118 
120  queryWorldPositionAndNormal(int x, int y) = 0;
121 
122  //virtual UT_Tuple<int, int, int, int> size() const = 0;
123  virtual std::vector<int> size() = 0;
124 
125  SWIGOUT(%ignore addOpaqueEventCallback;)
126  virtual void addOpaqueEventCallback(void *callback) = 0;
127  SWIGOUT(%ignore removeOpaqueEventCallback;)
128  virtual void removeOpaqueEventCallback(void *callback) = 0;
129  SWIGOUT(%ignore opaqueEventCallbacks;)
130  virtual std::vector<void *> opaqueEventCallbacks() = 0;
131  SWIGOUT(%ignore clearOpaqueEventCallbacks;)
132  virtual void clearOpaqueEventCallbacks() = 0;
133 
134 #ifdef SWIG
135 // expose the handling of the viewport callbacks to HOM
136 %extend
137 {
138  void addEventCallback(InterpreterObject callback)
139  {
140  self->addOpaqueEventCallback(callback);
141  }
142 
143  void removeEventCallback(InterpreterObject callback)
144  {
145  self->removeOpaqueEventCallback(callback);
146  }
147 
148  void clearEventCallbacks()
149  {
150  self->clearOpaqueEventCallbacks();
151  }
152 
153  std::vector<InterpreterObject> eventCallbacks()
154  {
155  std::vector<void *> opaque_callbacks(self->opaqueEventCallbacks());
156 
157  std::vector<InterpreterObject> callbacks;
158  for (int i = 0; i< opaque_callbacks.size(); ++i)
159  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
160  return callbacks;
161  }
162 }
163 #endif
164 
165 };
166 
167 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1210
GLsizeiptr size
Definition: glew.h:1681
GLuint const GLchar * name
Definition: glew.h:1814
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
#define HOM_API
Definition: HOM_API.h:13
GLint GLint GLint GLint GLint x
Definition: glew.h:1252
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1252
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1209
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
GLsizei const GLchar *const * string
Definition: glew.h:1844
HOM_GeometryViewport(const HOM_GeometryViewport &)
type
Definition: core.h:528