OTB  6.7.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::GlView Class Reference

#include <otbGlView.h>

+ Inheritance diagram for otb::GlView:
+ Collaboration diagram for otb::GlView:

Public Types

typedef std::map< std::string,
ActorType::Pointer
ActorMapType
 
typedef otb::GlActor ActorType
 
typedef itk::SmartPointer
< const Self
ConstPointer
 
typedef
StringVectorType::value_type 
KeyType
 
typedef itk::SmartPointer< SelfPointer
 
typedef GlView Self
 
typedef std::vector< std::string > StringVectorType
 
typedef itk::Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

std::string AddActor (ActorType *actor, const std::string &key="")
 
void AfterRendering ()
 
void BeforeRendering ()
 
void ClearActors ()
 
bool ContainsActor (const KeyType &key) const
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
ActorType::Pointer GetActor (const std::string &key) const
 
std::vector< std::string > GetActorsKeys () const
 
const StringVectorTypeGetRenderingOrder () const
 
virtual const ViewSettingsGetSettings () const
 
void HeavyRender ()
 
void Initialize (unsigned int sx, unsigned int sy)
 
 itkGetObjectMacro (Settings, ViewSettings)
 
void LightRender ()
 
void MoveActorInRenderingOrder (std::string key, bool down=false)
 
void MoveActorToEndOfRenderingOrder (std::string key, bool front=false)
 
bool RemoveActor (const std::string &key)
 
void Resize (unsigned int sx, unsigned int sy)
 
void RotateRenderingOrder (bool down=false)
 
void SaveScreenshot (const std::string &filename) const
 
void SetRenderingOrder (const StringVectorType &keys, bool front)
 
virtual void SetSettings (ViewSettings *_arg)
 
template<typename P , typename S , typename P2 , typename S2 >
bool ReprojectFromView (P &center, S &spacing, const KeyType &key, const P2 &vcenter, const S2 &vspacing, double norm=1000.0) const
 
template<typename P >
vcl_size_t GetExtent (P &origin, P &extent, bool isOverlay=false) const
 
template<typename Point , typename Spacing >
bool ZoomToExtent (const Spacing &native, Point &center, Spacing &spacing) const
 
template<typename Point , typename Spacing >
bool ZoomToLayer (const KeyType &key, const Spacing &native, Point &center, Spacing &spacing) const
 
template<typename Point , typename Spacing >
bool ZoomToRegion (const Point &origin, const Point &extent, const Spacing &native, Point &center, Spacing &spacing) const
 
template<typename Point , typename Spacing >
bool ZoomToFull (const KeyType &key, Point &center, Spacing &spacing, double units=1000.0) const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const char * GetNameOfClass () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 GlView ()
 
 ~GlView () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

 GlView (const Self &)
 
void operator= (const Self &)
 

Private Attributes

ActorMapType m_Actors
 
StringVectorType m_RenderingOrder
 
ViewSettings::Pointer m_Settings
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Detailed Description

The GlView class acts like an OpenGl scene where actors deriving from the GlActor class can be rendered. The GlView class contains the OpenGl viewport and manages:

All parameters related to scene description (origin, spacing, angle ...) are stored and managed by the ViewSettings class.

Definition at line 82 of file otbGlView.h.

Member Typedef Documentation

typedef std::map<std::string,ActorType::Pointer> otb::GlView::ActorMapType

Definition at line 93 of file otbGlView.h.

Definition at line 92 of file otbGlView.h.

Definition at line 89 of file otbGlView.h.

typedef StringVectorType::value_type otb::GlView::KeyType

Type definition for otb::GlActor storage key.

Definition at line 99 of file otbGlView.h.

Definition at line 88 of file otbGlView.h.

Definition at line 86 of file otbGlView.h.

typedef std::vector<std::string> otb::GlView::StringVectorType

Definition at line 94 of file otbGlView.h.

Definition at line 87 of file otbGlView.h.

Constructor & Destructor Documentation

otb::GlView::GlView ( )
protected
otb::GlView::~GlView ( )
overrideprotected
otb::GlView::GlView ( const Self )
private

Member Function Documentation

std::string otb::GlView::AddActor ( ActorType actor,
const std::string &  key = "" 
)

This method allows adding a new actor (deriving from GlActor) to the GlView. The actor can be identified by an optional key. If not provided, and the default value is used, the method will generate a key to identify the actor. In both case, the key is returned by the method.

Parameters
actorThe actor to be added
keyThe key to be used to identify the actor (default to empty string)
Returns
The key identifying the actor (either passed to the method or generated by it).
void otb::GlView::AfterRendering ( )

This method handles all the things that should be after before rendering.

void otb::GlView::BeforeRendering ( )

This method handles all the things that should be done before rendering.

void otb::GlView::ClearActors ( )

This method will remove all existing actors at once.

bool otb::GlView::ContainsActor ( const KeyType key) const

Tells whether an otb::GlActor is contained given its storage key.

Parameters
keyotb::GlActor storage key.
Returns
true if an otb::GlActor is contained given storage key.
virtual::itk::LightObject::Pointer otb::GlView::CreateAnother ( void  ) const
virtual

Reimplemented from itk::Object.

ActorType::Pointer otb::GlView::GetActor ( const std::string &  key) const

This method allows retrieving a pointer to the actor identified by the given key.

Parameters
keyThe key identifying the actor to retrieve
Returns
A pointer to the retrieved actor. This pointer will be null if no actor could be found with this key.
std::vector<std::string> otb::GlView::GetActorsKeys ( ) const

This method will return a vector containing the keys of all actors.

Returns
A vector of string containing the keys of all actors.
template<typename P >
vcl_size_t otb::GlView::GetExtent ( P &  origin,
P &  extent,
bool  isOverlay = false 
) const

Reproject point and spacing expressed in viewport coordinate system into given actor coordinate system.

Definition at line 425 of file otbGlView.h.

const StringVectorType& otb::GlView::GetRenderingOrder ( ) const
inline

Definition at line 201 of file otbGlView.h.

virtual const ViewSettings* otb::GlView::GetSettings ( ) const
virtual
void otb::GlView::HeavyRender ( )

This method will update the rendering of the OpenGl viewport, taking into account all parameters in the ViewSettings, but will first compute and load any missing data for a complete rendering. As such, this update routine can be time consuming.

void otb::GlView::Initialize ( unsigned int  sx,
unsigned int  sy 
)

The Initialize method will reset the OpenGl viewport to the given size, clear view settings and remove any existing actor.

Parameters
sxWidth of the viewport
syHeight of the viewport
otb::GlView::itkGetObjectMacro ( Settings  ,
ViewSettings   
)
void otb::GlView::LightRender ( )

This method will update the rendering of the OpenGl viewport, taking into account all parameters in the ViewSettings, without fetching any missing data from disk or RAM. It is therefore very fast.

void otb::GlView::MoveActorInRenderingOrder ( std::string  key,
bool  down = false 
)
void otb::GlView::MoveActorToEndOfRenderingOrder ( std::string  key,
bool  front = false 
)
static Pointer otb::GlView::New ( )
static
void otb::GlView::operator= ( const Self )
private
bool otb::GlView::RemoveActor ( const std::string &  key)

This method will try to remove the actor identified by the given key.

Parameters
keyThe key identifying the actor to remove
Returns
True if the actor has been found and removed, false otherwise
template<typename P , typename S , typename P2 , typename S2 >
bool otb::GlView::ReprojectFromView ( P &  center,
S &  spacing,
const KeyType key,
const P2 &  vcenter,
const S2 &  vspacing,
double  norm = 1000.0 
) const

Reproject point and spacing expressed in viewport coordinate system into given actor coordinate system.

Definition at line 304 of file otbGlView.h.

References otb::assert_NaN(), itk::SmartPointer< TObjectType >::GetPointer(), otb::GeoInterface::GetSpacing(), itk::SmartPointer< TObjectType >::IsNull(), and otb::GeoInterface::TransformFromViewport().

void otb::GlView::Resize ( unsigned int  sx,
unsigned int  sy 
)
void otb::GlView::RotateRenderingOrder ( bool  down = false)
void otb::GlView::SaveScreenshot ( const std::string &  filename) const
void otb::GlView::SetRenderingOrder ( const StringVectorType keys,
bool  front 
)

Arbitrary set the rendering order of some or all of contained otb::GlActor instances.

Keys which are not contained will be ignored.

Parameters
keysThe ordered sequence of keys.
fronttrue to order selected otb::GlActor instances in front of non-selected ones.
virtual void otb::GlView::SetSettings ( ViewSettings _arg)
virtual
template<typename Point , typename Spacing >
bool otb::GlView::ZoomToExtent ( const Spacing &  native,
Point &  center,
Spacing &  spacing 
) const

Reproject point and spacing expressed in viewport coordinate system into given actor coordinate system.

Definition at line 503 of file otbGlView.h.

template<typename Point , typename Spacing >
bool otb::GlView::ZoomToFull ( const KeyType key,
Point &  center,
Spacing &  spacing,
double  units = 1000.0 
) const

Reproject point and spacing expressed in viewport coordinate system into given actor coordinate system.

Definition at line 615 of file otbGlView.h.

References itk::SmartPointer< TObjectType >::GetPointer(), otb::GeoInterface::GetSpacing(), itk::SmartPointer< TObjectType >::IsNull(), and otb::GeoInterface::TransformFromViewport().

template<typename Point , typename Spacing >
bool otb::GlView::ZoomToLayer ( const KeyType key,
const Spacing &  native,
Point &  center,
Spacing &  spacing 
) const

Reproject point and spacing expressed in viewport coordinate system into given actor coordinate system.

Definition at line 526 of file otbGlView.h.

References itk::SmartPointer< TObjectType >::IsNull().

template<typename Point , typename Spacing >
bool otb::GlView::ZoomToRegion ( const Point &  origin,
const Point &  extent,
const Spacing &  native,
Point &  center,
Spacing &  spacing 
) const

Reproject point and spacing expressed in viewport coordinate system into given actor coordinate system.

Definition at line 552 of file otbGlView.h.

Member Data Documentation

ActorMapType otb::GlView::m_Actors
private

Definition at line 294 of file otbGlView.h.

StringVectorType otb::GlView::m_RenderingOrder
private

Definition at line 296 of file otbGlView.h.

ViewSettings::Pointer otb::GlView::m_Settings
private

Definition at line 292 of file otbGlView.h.


The documentation for this class was generated from the following file: