VR-Vantage
Loading...
Searching...
No Matches
DtChannel.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2023 MAK Technologies, Inc.
3** All rights reserved.
4******************************************************************************/
5
9
10#pragma once
11
12#include <vrvCore/vrvCore.h>
13
15
19#include <vrvUtil/signalslib.h>
20
21#include <vrvMath/DtVector4.h>
22
23namespace makVrv
24{
25 class DtDe;
26 class DtWindow;
27 class DtObserverObject;
28 class DtMouseEvent;
29 class DtKeyEvent;
30 class DtSensor;
32
36 {
37 protected:
40
41 public:
42
44 virtual ~DtChannel();
45
48
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
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
101
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 ) const = 0;
117
119 virtual void projectToWorld( double screenX, double screenY,
120 double& dbX, double& dbY, double& dbZ ) const = 0;
121
128 virtual DtIntersectorResult findWorldIntersection(double screenX, double screenY,
130 std::vector<DtElementID>* ignoreList = 0) = 0;
131
133 virtual void moveMouseToScreenLocation( float pixelX, float pixelY ) = 0;
134
136 std::string& observerName();
137
139 virtual void screenCapture() = 0;
140
142 virtual void updateCameraFrustumPlanes( std::vector< DtVector4<double> >& planes ) = 0;
143
146 virtual void updateAcquisitionBoxFrustumPlanes(const int& boxCenterX, const int& boxCenterY,
147 const int& boxWidth, const int& boxHeight, std::vector< DtVector4<double> >& planes ) = 0;
148
155 virtual std::vector<DtElementID> entitiesInFrustum() = 0;
156
159 virtual double lastEffectiveViewMagnification() const = 0;
160
161 protected:
162 virtual void connectToObserver() = 0;
163
165 virtual void observerAdded( const std::string& observerName );
167 virtual void observerRemoved( const std::string& observerName );
168
169 protected:
170
174
177 std::string myObserverName;
179
180 private:
181
184
187
190 };
191
197 {
198
199 public:
203
206
208 virtual DtChannel* create(DtDe& de, DtWindow* window,
210 };
211}
Contains makVrv::DtChannelConfiguration class.
Contains makVrv:DtIntersector class.
Base class to provide boost signal/slot management.
4 dimensional vector
Contains makVrv::DtVirtualBaseClass class.
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition DtChannelConfiguration.h:27
ProjectionResizePolicy
Definition DtChannelConfiguration.h:45
The abstract channel creator for the abstract channel class.
Definition DtChannel.h:197
static void registerInstance(DtDe &de, DtChannelCreator *instance)
Register the creator instance with an IG.
static DtChannelCreator & instance(DtDe &theIG)
Get the channel creator instance for this IG object.
virtual DtChannel * create(DtDe &de, DtWindow *window, DtChannelConfiguration &)=0
Create a Channel.
The abstract Channel Class.
Definition DtChannel.h:36
DtChannel & operator=(const DtChannel &)
Assignment Operator not implemented - Copy not allowed.
virtual DtIntersectorResult findWorldIntersection(double screenX, double screenY, DtIntersector::IntersectProperties properties=DtIntersector::AllNodes, std::vector< DtElementID > *ignoreList=0)=0
virtual void setObserverName(const std::string &observerName)
set the name of the observer to use, and attempt to connect
DtDe & myDe
Definition DtChannel.h:171
virtual void setClearColor(float r, float g, float b, float a)=0
Set the clear color of the channel.
virtual double lastEffectiveViewMagnification() const =0
virtual void setSensorName(const std::string &sensorName)=0
virtual void observerRemoved(const std::string &observerName)
connected to the signal_observerRemoved so the channel can disconnect from the observer when it is re...
std::string & observerName()
Retrieve the observer name for this channel.
DtChannel()
Default Constructor not implemented.
virtual void update()=0
Update a channel.
DtObserverObject * findObserver() const
Attempt to get the observer for the channel.
virtual bool channelEnabled() const =0
Enable/Disable the channel. When a channel is disabled, it no longer renders or receives key/mouse ev...
virtual void screenCapture()=0
Takes Screen capture of the current channel.
virtual void moveMouseToScreenLocation(float pixelX, float pixelY)=0
Places the mouse cursor at the specified x/y position on the screen.
virtual void projectToScreen(double dbX, double dbY, double dbZ, double &screenX, double &screenY, double &screenZ) const =0
virtual ~DtChannel()
DTOR.
virtual void updateAcquisitionBoxFrustumPlanes(const int &boxCenterX, const int &boxCenterY, const int &boxWidth, const int &boxHeight, std::vector< DtVector4< double > > &planes)=0
virtual bool processMouseEvent(const DtMouseEvent &ev)=0
attempt to handle a mouse event with the channel's overlay
std::string myObserverName
Definition DtChannel.h:177
virtual void observerAdded(const std::string &observerName)
connected to the signal_observerAdded so the channel can connect to the correct observer when it is a...
virtual void setProjectionResizePolicy(DtChannelConfiguration::ProjectionResizePolicy policy)
Set the policy used to determine if and how the projection matrix should be adjusted on window resize...
virtual void updateCameraFrustumPlanes(std::vector< DtVector4< double > > &planes)=0
Set the Frustum planes for this channel, called from DtOsgChannel.
DtChannelConfiguration & myChannelConfiguration
Definition DtChannel.h:172
virtual void setCameraPosition(double x, double y, double z)=0
Set the channel's camera position.
virtual DtChannelConfiguration::ProjectionResizePolicy projectionResizePolicy() const
Get the policy used to determine if and how the projection matrix should be adjusted on window resize...
DtObserverObject * myObserver
Definition DtChannel.h:176
virtual void updateProjection()=0
virtual void setViewport(int x, int y, int width, int height)=0
Set the viewport of the channel.
virtual void setWindow(DtWindow *)=0
Set the window the channel is displayed on.
DtChannel(const DtChannel &)
Copy Constructor not implemented - Copy not allowed.
virtual void projectToWorld(double screenX, double screenY, double &dbX, double &dbY, double &dbZ) const =0
project the local database coordinates given screen coordinates
virtual void setChannelEnabled(bool enabled, bool partial=false)=0
Enable/Disable the channel. When a channel is disabled, it no longer renders and receives key/mouse e...
virtual void connectToObserver()=0
virtual std::vector< DtElementID > entitiesInFrustum()=0
virtual const DtWindow * window() const =0
Get the window the channel is displayed on.
virtual void getViewport(int &x, int &y, int &width, int &height) const =0
Get the viewport.
virtual bool processKeyboardEvent(const DtKeyEvent &ev)=0
attempt to handle a keyboard event with the channel's overlay
DtSignalConnectionManager myConnections
Definition DtChannel.h:173
const DtChannelConfiguration & configuration() const
Get the configuration.
DtChannelConfiguration::ProjectionResizePolicy myProjectionResizePolicy
Definition DtChannel.h:178
DtModelSetId myModelSet
Definition DtChannel.h:175
DtChannel(DtDe &de, DtChannelConfiguration &)
The constructor for an abstract class is not public.
DtModelSetId currentModelSet() const
Get the current model set.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer,...
Definition DtDe.h:77
IntersectProperties
Definition DtIntersector.h:33
@ AllNodes
Definition DtIntersector.h:34
Descriptor for a single intersection result.
Definition DtIntersectorResult.h:22
This class encapsulates a Key event.
Definition DtKeyEvent.h:17
This class encapsulates a mouse button event.
Definition DtMouseEvent.h:20
This abstract base class defines the interface for OS-specific keyboard and mouse event listeners.
Definition DtObserverObject.h:36
Definition DtSensor.h:31
Class to manage disconnection of boost connections on deletion.
Definition DtSignalConnectionManager.h:21
4 dimensional vector
Definition DtVector4.h:28
DtVirtualBaseClass()
Do nothing constructor.
Abstract Base class.
Definition DtWindow.h:26
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
DtModelSetId
Definition DtModelSetEnums.h:20
Contains DLL export macros.
#define DT_DLL_VRVCORE
Definition vrvCore.h:20