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_ElemPtr.h"
15 #include "HOM_Errors.h"
16 #include "HOM_Module.h"
17 #include "HOM_ObjNode.h"
18 #include "HOM_EnumValue.h"
19 #include <UT/UT_Tuple.h>
20 
21 class HOM_Drawable;
24 class HOM_Selection;
25 class HOM_Vector2;
26 
27 SWIGOUT(%rename(GeometryViewport) HOM_GeometryViewport;)
28 
30 {
31 public:
33  { HOM_CONSTRUCT_OBJECT(this) }
35  { HOM_CONSTRUCT_OBJECT(this) }
37  { HOM_DESTRUCT_OBJECT(this) }
38 
39  virtual std::string __repr__() = 0;
40 
41  SWIGOUT(%warnfilter(321) type;)
42  virtual HOM_EnumValue& type() = 0;
43  virtual void changeType(HOM_EnumValue &type) = 0;
44 
45  SWIGOUT(%newobject settings;)
46  virtual HOM_GeometryViewportSettings *settings() = 0;
47 
48  virtual std::string name() = 0;
49  virtual void changeName(std::string &name) = 0;
50 
51  virtual void home() = 0;
52 
53  virtual void homeAll() = 0;
54  virtual void homeSelected() = 0;
55  virtual void homeGrid() = 0;
56  virtual void homeNonTemplated() = 0;
57  virtual void homeBoundingBox(HOM_BoundingBox *bbox, bool center_to_origin = false) = 0;
58 
59  virtual void frameAll() = 0;
60  virtual void frameBoundingBox(HOM_BoundingBox *bbox = NULL) = 0;
61  virtual void frameSelected() = 0;
62  virtual void frameGrid() = 0;
63  virtual void frameNonTemplated() = 0;
64 
65  virtual void draw() = 0;
66 
67  SWIGOUT(%newobject viewTransform;)
68  virtual HOM_Matrix4 *viewTransform() = 0;
69 
70  SWIGOUT(%newobject modelToGeometryTransform;)
71  virtual HOM_Matrix4 *modelToGeometryTransform() = 0;
72  SWIGOUT(%newobject cameraToModelTransform;)
73  virtual HOM_Matrix4 *cameraToModelTransform() = 0;
74  SWIGOUT(%newobject ndcToCameraTransform;)
75  virtual HOM_Matrix4 *ndcToCameraTransform() = 0;
76  SWIGOUT(%newobject viewportToNDCTransform;)
77  virtual HOM_Matrix4 *viewportToNDCTransform() = 0;
78  SWIGOUT(%newobject windowToViewportTransform;)
79  virtual HOM_Matrix4 *windowToViewportTransform() = 0;
80 
81  SWIGOUT(%newobject viewPivot;)
82  virtual HOM_Vector3 *viewPivot() = 0;
83 
84  virtual std::vector<int> resolutionInPixels() = 0;
85 
86  SWIGOUT(%newobject camera;)
87  virtual HOM_ObjNode *camera() = 0;
88  virtual std::string cameraPath() = 0;
89  virtual void setCamera(HOM_ObjNode &camera_node) = 0;
90  virtual void setCamera(const char *camera_path) = 0;
91  virtual void saveViewToCamera(HOM_ObjNode &camera_node) = 0;
92 
93  SWIGOUT(%newobject defaultCamera;)
94  virtual HOM_GeometryViewportCamera *defaultCamera() =0;
95  virtual void setDefaultCamera(HOM_GeometryViewportCamera *cam_settings) =0;
96  virtual void useDefaultCamera() =0;
97 
98  virtual bool isCameraLockedToView() = 0;
99  virtual void lockCameraToView(bool) = 0;
100 
101  virtual bool isViewExportedToCameraContinuously() = 0;
102  virtual void exportViewToCameraContinuously(bool) = 0;
103 
104  virtual bool isActive2D() = 0;
105  virtual bool isActive3D() = 0;
106 
107  virtual bool usesConstructionPlane() = 0;
108 
109  SWIGOUT(%newobject queryNodeAtPixel;)
110  virtual HOM_Node *queryNodeAtPixel(int x, int y, bool pick_templates=false) = 0;
111  SWIGOUT(%newobject queryPrimAtPixel;)
112  virtual HOM_Prim *queryPrimAtPixel(HOM_Node *node, int x, int y) = 0;
113 
114  virtual std::vector<HOM_ElemPtr<HOM_Node>> _queryNodesInBox(int x, int y, int w, int h, bool pick_templates=false) = 0;
115 
116  virtual std::pair<int, int> _queryPrimOnDrawables(
117  const std::vector<HOM_Drawable *> &drawables,
118  int x, int y,
119  bool enable_occlusion,
120  bool handle_pick_radius = false) = 0;
121 
122  virtual std::vector<std::pair<int, HOM_ElemPtr<HOM_Selection> > >
123  _queryComponentsOnDrawables(
124  const std::vector<HOM_Drawable *> &drawables,
125  HOM_Vector2 &start, HOM_Vector2 *end_inclusive = nullptr,
126  bool enable_occlusion = false,
127  bool contained = false) = 0;
128 
129  SWIGOUT(%newobject queryInspectedGeometry;)
130  virtual HOM_Geometry *queryInspectedGeometry() = 0;
131  SWIGOUT(%newobject queryInspectedPrim;)
132  virtual HOM_Prim *queryInspectedPrim() = 0;
133 
134  virtual std::pair<HOM_ElemPtr<HOM_Vector3>, HOM_ElemPtr<HOM_Vector3> >
135  mapToWorld(double x, double y) = 0;
136 
137  virtual HOM_Vector2 *mapToScreen(const HOM_Vector3 &pos) = 0;
138 
139  virtual std::pair<int, int> mapFromMouseChop(double x, double y) = 0;
140 
142  queryWorldPositionAndNormal(int x, int y,
143  const HOM_EnumValue selection_restriction =
144  HOM_snapSelectionMode::SnapToAll)=0;
145 
146  virtual std::vector<int> size() = 0;
147  virtual std::vector<int> geometry() = 0;
148 
149  SWIGOUT(%ignore addOpaqueEventCallback;)
150  virtual void addOpaqueEventCallback(void *callback) = 0;
151  SWIGOUT(%ignore removeOpaqueEventCallback;)
152  virtual void removeOpaqueEventCallback(void *callback) = 0;
153  SWIGOUT(%ignore opaqueEventCallbacks;)
154  virtual std::vector<void *> opaqueEventCallbacks() = 0;
155  SWIGOUT(%ignore clearOpaqueEventCallbacks;)
156  virtual void clearOpaqueEventCallbacks() = 0;
157 
158 #ifdef SWIG
159 // expose the handling of the viewport callbacks to HOM
160 %extend
161 {
162  void addEventCallback(InterpreterObject callback)
163  {
164  self->addOpaqueEventCallback(callback);
165  }
166 
167  void removeEventCallback(InterpreterObject callback)
168  {
169  self->removeOpaqueEventCallback(callback);
170  }
171 
172  void clearEventCallbacks()
173  {
174  self->clearOpaqueEventCallbacks();
175  }
176 
177  std::vector<InterpreterObject> eventCallbacks()
178  {
179  std::vector<void *> opaque_callbacks(self->opaqueEventCallbacks());
180 
181  std::vector<InterpreterObject> callbacks;
182  for (int i = 0; i< opaque_callbacks.size(); ++i)
183  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
184  return callbacks;
185  }
186 }
187 #endif
188 
189 };
190 
191 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
GLuint start
Definition: glcorearb.h:475
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
GLint y
Definition: glcorearb.h:103
std::tuple< Types...> UT_Tuple
Definition: UT_Tuple.h:53
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
GLuint const GLchar * name
Definition: glcorearb.h:786
GLint GLenum GLint x
Definition: glcorearb.h:409
GLsizeiptr size
Definition: glcorearb.h:664
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
HOM_GeometryViewport(const HOM_GeometryViewport &)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
type
Definition: core.h:1059