VR-Vantage 3.0.3 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtChannel.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 
14 #include <vrvCore/DtIntersector.h>
15 
19 #include <vrvUtil/signalslib.h>
20 
22 
23 namespace makVrv
24 {
25  class DtDe;
26  class DtWindow;
27  class DtObserverObject;
28  class DtMouseEvent;
29  class DtKeyEvent;
30  class DtSensor;
31  class DtIntersectorResult;
32 
36  {
37  protected:
40 
41  public:
42 
44  virtual ~DtChannel();
45 
47  DtObserverObject* findObserver() const;
48 
50  unsigned int currentModelSet() const;
51 
53  virtual void setClearColor(float r,float g,float b, float a) = 0;
54 
56  virtual void setViewport(int x,int y,int width, int height) = 0;
57 
59  virtual void getViewport(int& x,int& y, int& width,int& height) const = 0;
60 
62  virtual void setWindow(DtWindow*) = 0;
63 
65  virtual void setCameraPosition(double x, double y, double z) = 0;
66 
68  virtual const DtWindow* window() const = 0;
69 
72  virtual void setChannelEnabled(bool enabled, bool partial=false) = 0;
73 
76  virtual bool channelEnabled() const = 0;
77 
79  virtual void update() = 0;
80 
82  const DtChannelConfiguration& configuration() const;
83 
86  virtual void updateProjection() = 0;
87 
89  virtual void setObserverName( const std::string& observerName );
90 
95  virtual void setSensorName( const std::string& sensorName ) = 0;
96 
99  virtual void setProjectionResizePolicy(
101 
105  projectionResizePolicy() const;
106 
108  virtual bool processMouseEvent( const DtMouseEvent& ev) = 0;
109 
111  virtual bool processKeyboardEvent( const DtKeyEvent& ev) = 0;
112 
115  virtual void projectToScreen( double dbX, double dbY, double dbZ,
116  double& screenX, double& screenY, double& screenZ ) = 0;
117 
119  virtual void projectToWorld( double screenX, double screenY,
120  double& dbX, double& dbY, double& dbZ ) = 0;
121 
124  virtual DtIntersectorResult findWorldIntersection(double screenX, double screenY,
126  std::vector<DtElementID>* ignoreList = 0) = 0;
127 
129  virtual void moveMouseToScreenLocation( float pixelX, float pixelY ) = 0;
130 
132  std::string& observerName();
133 
135  virtual void screenCapture() = 0;
136 
138  virtual void updateCameraFrustumPlanes( std::vector< DtVector4<double> >& planes ) = 0;
139 
142  virtual void updateAcquisitionBoxFrustumPlanes(const int& boxCenterX, const int& boxCenterY,
143  const int& boxWidth, const int& boxHeight, std::vector< DtVector4<double> >& planes ) = 0;
144 
145  protected:
146  virtual void connectToObserver() = 0;
147 
149  virtual void observerAdded( const std::string& observerName );
151  virtual void observerRemoved( const std::string& observerName );
152 
153  protected:
154 
158 
163 
164  private:
165 
167  DtChannel();
168 
170  DtChannel(const DtChannel&);
171 
173  DtChannel &operator=(const DtChannel &);
174  };
175 
181  {
182 
183  public:
186  static DtChannelCreator& instance(DtDe& theIG);
187 
189  static void registerInstance(DtDe& de, DtChannelCreator* instance);
190 
192  virtual DtChannel* create(DtDe& de, DtWindow* window,
194  };
195 }


Copyright © 2005-2023 MAK Technologies. All Rights Reserved (www.mak.com)