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 std::string cameraPath() = 0;
86  virtual void setCamera(HOM_ObjNode &camera_node) = 0;
87  virtual void setCamera(const char *camera_path) = 0;
88  virtual void saveViewToCamera(HOM_ObjNode &camera_node) = 0;
89 
90  SWIGOUT(%newobject defaultCamera;)
91  virtual HOM_GeometryViewportCamera *defaultCamera() =0;
92  virtual void setDefaultCamera(HOM_GeometryViewportCamera *cam_settings) =0;
93  virtual void useDefaultCamera() =0;
94 
95  virtual bool isCameraLockedToView() = 0;
96  virtual void lockCameraToView(bool) = 0;
97 
98  virtual bool isActive2D() = 0;
99  virtual bool isActive3D() = 0;
100 
101  virtual bool usesConstructionPlane() = 0;
102 
103  SWIGOUT(%newobject queryNodeAtPixel;)
104  virtual HOM_Node *queryNodeAtPixel(int x, int y, bool pick_templates=false) = 0;
105  SWIGOUT(%newobject queryPrimAtPixel;)
106  virtual HOM_Prim *queryPrimAtPixel(HOM_Node *node, int x, int y) = 0;
107 
108  virtual std::pair<int, int> _queryPrimOnDrawables(const std::vector<HOM_SimpleDrawable *> &drawables, int x, int y, bool enable_occulsion) = 0;
109 
110  SWIGOUT(%newobject queryInspectedGeometry;)
111  virtual HOM_Geometry *queryInspectedGeometry() = 0;
112  SWIGOUT(%newobject queryInspectedPrim;)
113  virtual HOM_Prim *queryInspectedPrim() = 0;
114 
115  virtual std::pair<HOM_ElemPtr<HOM_Vector3>, HOM_ElemPtr<HOM_Vector3> >
116  mapToWorld(double x, double y) = 0;
117 
118  virtual HOM_Vector2 *mapToScreen(const HOM_Vector3 &pos) = 0;
119 
120  virtual std::pair<int, int> mapFromMouseChop(double x, double y) = 0;
121 
123  queryWorldPositionAndNormal(int x, int y,
124  const HOM_EnumValue selection_restriction =
125  HOM_snapSelectionMode::SnapToAll)=0;
126 
127  virtual std::vector<int> size() = 0;
128  virtual std::vector<int> geometry() = 0;
129 
130  SWIGOUT(%ignore addOpaqueEventCallback;)
131  virtual void addOpaqueEventCallback(void *callback) = 0;
132  SWIGOUT(%ignore removeOpaqueEventCallback;)
133  virtual void removeOpaqueEventCallback(void *callback) = 0;
134  SWIGOUT(%ignore opaqueEventCallbacks;)
135  virtual std::vector<void *> opaqueEventCallbacks() = 0;
136  SWIGOUT(%ignore clearOpaqueEventCallbacks;)
137  virtual void clearOpaqueEventCallbacks() = 0;
138 
139 #ifdef SWIG
140 // expose the handling of the viewport callbacks to HOM
141 %extend
142 {
143  void addEventCallback(InterpreterObject callback)
144  {
145  self->addOpaqueEventCallback(callback);
146  }
147 
148  void removeEventCallback(InterpreterObject callback)
149  {
150  self->removeOpaqueEventCallback(callback);
151  }
152 
153  void clearEventCallbacks()
154  {
155  self->clearOpaqueEventCallbacks();
156  }
157 
158  std::vector<InterpreterObject> eventCallbacks()
159  {
160  std::vector<void *> opaque_callbacks(self->opaqueEventCallbacks());
161 
162  std::vector<InterpreterObject> callbacks;
163  for (int i = 0; i< opaque_callbacks.size(); ++i)
164  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
165  return callbacks;
166  }
167 }
168 #endif
169 
170 };
171 
172 #endif
type
Definition: core.h:977
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1238
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:353
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
GLuint const GLchar * name
Definition: glcorearb.h:785
GLint GLenum GLint x
Definition: glcorearb.h:408
GLsizeiptr size
Definition: glcorearb.h:663
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1237
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
HOM_GeometryViewport(const HOM_GeometryViewport &)
GLint y
Definition: glcorearb.h:102