VR-Vantage API Documentation
DtChannel.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
16 #include <boost/signals.hpp>
17 
18 namespace makVrv
19 {
20  class DtDe;
21  class DtWindow;
22  class DtObserverObject;
23  class DtMouseEvent;
24  class DtKeyEvent;
25  class DtSensor;
26 
30  {
31 
32  protected:
35 
36  public:
37 
39  virtual ~DtChannel();
40 
42  DtObserverObject* findObserver() const;
43 
45  unsigned int currentModelSet() const;
46 
48  virtual void setClearColor(float r,float g,float b, float a) = 0;
49 
51  virtual void setViewport(int x,int y,int width, int height) = 0;
52 
54  virtual void getViewport(int& x,int& y, int& width,int& height) const = 0;
55 
57  virtual void setWindow(DtWindow*) = 0;
58 
60  virtual void setCameraPosition(double x, double y, double z) = 0;
61 
63  virtual const DtWindow* window() const = 0;
64 
66  virtual void update() = 0;
67 
69  const DtChannelConfiguration& configuration() const;
70 
73  virtual void updateProjection() = 0;
74 
76  virtual void setDynamicNearFar(bool enable) = 0;
77 
80  virtual void setNearFarRatio(double ratio) = 0;
81 
83  virtual void setObserverName( const std::string& observerName );
84 
89  virtual void setSensorName( const std::string& sensorName ) = 0;
90 
93  virtual void setProjectionResizePolicy(
95 
99  projectionResizePolicy() const;
100 
102  virtual bool processMouseEvent( const DtMouseEvent& ev) = 0;
103 
105  virtual bool processKeyboardEvent( const DtKeyEvent& ev) = 0;
106 
109  virtual void projectToScreen( double dbX, double dbY, double dbZ,
110  double& screenX, double& screenY, double& screenZ ) = 0;
111 
113  virtual void projectToWorld( double screenX, double screenY,
114  double& dbX, double& dbY, double& dbZ ) = 0;
115 
117  virtual void moveMouseToScreenLocation( float pixelX, float pixelY ) = 0;
118 
119  protected:
122  virtual void setProjectionMatrixAsPerspective(double fovy,
123  double aspectRatio, double zNear, double zFar) = 0;
124 
126  virtual void setProjectionMatrixAsFrustum (double left, double right,
127  double bottom, double topz,
128  double zNear, double zFar) = 0;
129 
130  virtual void connectToObserver() = 0;
131 
132  void observerAdded( const std::string& observerName );
133  void observerRemoved( const std::string& observerName );
134 
135  protected:
136 
140 
143  std::string myObserverName;
145  };
146 
152  {
153 
154  public:
157  static DtChannelCreator& instance(DtDe& theIG);
158 
160  static void registerInstance(DtDe& de, DtChannelCreator* instance);
161 
163  virtual DtChannel* create(DtDe& de, DtWindow* window,
165  };
166 }


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)