VisionWorks Toolkit Reference

April 8, 2016 | 1.4 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Render3D.hpp
Go to the documentation of this file.
1 /*
2 # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 # * Neither the name of NVIDIA CORPORATION nor the names of its
13 # contributors may be used to endorse or promote products derived
14 # from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef NVXIO_RENDER3D_HPP
30 #define NVXIO_RENDER3D_HPP
31 
32 #include <string>
33 #include <vector>
34 
35 #include <VX/vx.h>
36 #include <NVXIO/Export.hpp>
37 #include <NVXIO/Render.hpp>
38 
44 namespace nvxio {
45 
60 class NVXIO_EXPORT Render3D
61 {
62 public:
63 
68  {
70  BASE_RENDER_3D
71  };
72 
80  struct PlaneStyle
81  {
84  };
85 
94  {
97  };
98 
103  {
110  MouseMove
111  };
112 
120  typedef void (*OnKeyboardEventCallback)(void* context, vx_char key, vx_uint32 x, vx_uint32 y);
128  typedef void (*OnMouseEventCallback)(void* context, MouseButtonEvent event, vx_uint32 x, vx_uint32 y);
129 
135  virtual void setOnKeyboardEventCallback(OnKeyboardEventCallback callback, void* context) = 0;
141  virtual void setOnMouseEventCallback(OnMouseEventCallback callback, void* context) = 0;
142 
151  virtual void putPlanes(vx_array planes, vx_matrix model, const PlaneStyle& style) = 0;
152 
159  virtual void putPointCloud(vx_array points, vx_matrix model, const PointCloudStyle& style) = 0;
160 
161 
166  virtual bool flush() = 0;
167 
171  virtual void close() = 0;
172 
178  virtual void setViewMatrix(vx_matrix view) = 0;
179 
185  virtual void getViewMatrix(vx_matrix view) const = 0;
186 
192  virtual void setProjectionMatrix(vx_matrix projection) = 0;
198  virtual void getProjectionMatrix(vx_matrix projection) const = 0;
199 
204  virtual void setDefaultFOV(float fov) = 0;
205 
211  virtual void enableDefaultKeyboardEventCallback() = 0;
215  virtual void disableDefaultKeyboardEventCallback() = 0;
220  virtual bool useDefaultKeyboardEventCallback() = 0;
221 
226  virtual vx_uint32 getWidth() const = 0;
231  virtual vx_uint32 getHeight() const = 0;
232 
237  virtual void putImage(vx_image image) = 0;
238 
244  virtual void putText(const std::string& text, const nvxio::Render::TextBoxStyle& style) = 0;
245 
249  virtual ~Render3D()
250  {}
251 
252 protected:
253  Render3D(TargetType type = Render3D::UNKNOWN_RENDER, const std::string& name = "Undefined"):
254  targetType(type),
255  renderName(name)
256  {}
257 
259  const std::string renderName;
260 };
261 
274 NVXIO_EXPORT std::unique_ptr<Render3D> createDefaultRender3D(vx_context context, int xPos, int yPos,const std::string& title,
275  vx_uint32 width, vx_uint32 height);
276 }
277 
278 #endif
struct _vx_image * vx_image
An opaque reference to an image.
Definition: vx_types.h:186
NVXIO_EXPORT std::unique_ptr< Render3D > createDefaultRender3D(vx_context context, int xPos, int yPos, const std::string &title, vx_uint32 width, vx_uint32 height)
Creates Render3D.
const TargetType targetType
Definition: Render3D.hpp:258
vx_float32 maxDistance
Holds the maximal distance that a point can have.
Definition: Render3D.hpp:96
struct _vx_array * vx_array
The Array Object. Array is a strongly-typed container for other data structures.
Definition: vx_types.h:279
TargetType
Defines Render3D types.
Definition: Render3D.hpp:67
Render3D(TargetType type=Render3D::UNKNOWN_RENDER, const std::string &name="Undefined")
Definition: Render3D.hpp:253
vx_float32 minDistance
Holds the minimal distance that a plane can have.
Definition: Render3D.hpp:82
vx_float32 maxDistance
Holds the maximal distance that a plane can have.
Definition: Render3D.hpp:83
Indicates the left mouse button has been pressed down.
Definition: Render3D.hpp:104
char vx_char
An 8 bit ASCII character.
Definition: vx_types.h:85
float vx_float32
A 32-bit float value.
Definition: vx_types.h:138
Indicates a stub render.
Definition: Render3D.hpp:69
Holds the point cloud style.
Definition: Render3D.hpp:93
Render3D interface.
Definition: Render3D.hpp:60
struct _vx_context * vx_context
An opaque reference to the implementation context.
Definition: vx_types.h:222
Indicates a middle mouse button has been pressed down.
Definition: Render3D.hpp:106
Indicates the middle mouse button has been released.
Definition: Render3D.hpp:107
Indicates the right mouse button has been released.
Definition: Render3D.hpp:109
virtual ~Render3D()
Destructor.
Definition: Render3D.hpp:249
Holds the plane style.
Definition: Render3D.hpp:80
The Render interface and utility functions.
The top level OpenVX Header.
MouseButtonEvent
Defines mouse events.
Definition: Render3D.hpp:102
const std::string renderName
Definition: Render3D.hpp:259
Indicates the left mouse button has been released.
Definition: Render3D.hpp:105
Defines the text box parameters.
Definition: Render.hpp:92
uint32_t vx_uint32
A 32-bit unsigned value.
Definition: vx_types.h:100
vx_float32 minDistance
Holds the minimal distance that a point can have.
Definition: Render3D.hpp:95
struct _vx_matrix * vx_matrix
The Matrix Object. An MxN matrix of some unit type.
Definition: vx_types.h:249
Indicates the right mouse button has been pressed down.
Definition: Render3D.hpp:108