Public Member Functions | Static Public Member Functions | List of all members
HPS::View Class Reference

#include <sprk.h>

Inheritance diagram for HPS::View:
HPS::Sprocket HPS::Object

Public Member Functions

 View (View const &that)
 
 View (SprocketControl const &in_ctrl)
 
HPS::Type ObjectType () const
 
void Delete ()
 
Viewoperator= (View const &in_that)
 
void Assign (View const &in_that)
 
bool Equals (View const &in_that) const
 
bool operator!= (View const &in_that) const
 
bool operator== (View const &in_that) const
 
UTF8 GetName () const
 
HPS::ViewComputeFitWorldCamera (HPS::CameraKit &out_camera)
 
HPS::ViewComputeFitWorldCamera (SegmentKey const &in_segment, HPS::CameraKit &out_camera)
 
HPS::ViewComputeFitWorldCamera (BoundingKit const &in_bounding, HPS::CameraKit &out_camera)
 
HPS::ViewComputeFitWorldCamera (SegmentKey const &in_segment, MatrixKit const &in_transform, HPS::CameraKit &out_camera)
 
HPS::ViewComputeFitWorldCamera (BoundingKit const &in_bounding, MatrixKit const &in_transform, HPS::CameraKit &out_camera)
 
HPS::ViewFitWorld ()
 
HPS::ViewFitWorld (SegmentKey const &in_segment)
 
HPS::ViewFitWorld (BoundingKit const &in_bounding)
 
HPS::ViewFitWorld (SegmentKey const &in_segment, MatrixKit const &in_transform)
 
HPS::ViewFitWorld (BoundingKit const &in_bounding, MatrixKit const &in_transform)
 
void AttachModel (Model const &in_model)
 
void DetachModel ()
 
Model GetAttachedModel () const
 
IncludeKey GetAttachedModelIncludeLink () const
 
void SetRenderingMode (Rendering::Mode in_mode)
 
Rendering::Mode GetRenderingMode () const
 
OperatorPtrArray GetOperators () const
 
void SetOperators (OperatorPtrArray &in_operators)
 
void SetOperators (size_t in_count, OperatorPtr in_operators[])
 
void SetOperator (OperatorPtr const &in_operator)
 
void SetOperator (Operator *in_operator)
 
OperatorControl GetOperatorControl ()
 
OperatorControl const GetOperatorControl () const
 
NavigationCubeControl GetNavigationCubeControl ()
 
NavigationCubeControl const GetNavigationCubeControl () const
 
AxisTriadControl GetAxisTriadControl ()
 
AxisTriadControl const GetAxisTriadControl () const
 
SegmentKey GetSegmentKey ()
 
SegmentKey const GetSegmentKey () const
 
SegmentKey GetModelOverrideSegmentKey ()
 
SegmentKey const GetModelOverrideSegmentKey () const
 
PortfolioKey const GetPortfolioKey () const
 
PortfolioKey GetPortfolioKey ()
 
void SetSimpleShadow (bool in_state, float in_percent_offset=5.0f)
 
bool GetSimpleShadow ()
 
void SetSimpleReflection (bool in_state, float in_percent_offset=5.0f)
 
bool GetSimpleReflection ()
 
void Update (HPS::Sprocket::UpdateType in_update_type=Sprocket::UpdateType::Asynchronous) const
 
void Update (HPS::Window::UpdateControl const in_control, HPS::Time const time_limit=-1.) const
 
void SmoothTransition (HPS::CameraKit const &in_camera_kit, HPS::Time in_duration=0.5)
 
KeyArray const GetNavigationKeys ()
 
LayoutArray GetOwningLayouts ()
 
LayoutArray const GetOwningLayouts () const
 
- Public Member Functions inherited from HPS::Sprocket
 Sprocket (HPS::Sprocket const &in_that)=default
 
 Sprocket (Sprocket &&in_that)
 
- Public Member Functions inherited from HPS::Object
 Object (Object const &that)
 
Objectoperator= (Object const &other_object)
 
 Object (Object &&in_that)
 
Objectoperator= (Object &&in_that)
 
HPS::Type Type () const
 
virtual bool Empty () const
 
virtual void Reset ()
 
bool HasType (HPS::Type in_mask) const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 

Static Public Member Functions

static UTF8 GetHideStyleName ()
 
static UTF8 GetShowStyleName ()
 
- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 

Additional Inherited Members

- Public Types inherited from HPS::Sprocket
enum  UpdateType { Synchronous, Asynchronous }
 

Detailed Description

The View class is one of the four core display classes used in a Visualize application. It is meant to be used as part of a display hierarchy along with the Canvas, Layout, and Model objects. The View has a parent Layout and can contain a single Model. The View is meant to represent one particular camera's view of the scene. Like the other three core objects, the View is backed by a HPS::SegmentKey.

Member Function Documentation

void HPS::View::AttachModel ( Model const &  in_model)

Attaches a Model to this View. Only a single Model can be attached to a View at one time. If you attach a Model to a View which already has an attached Model, the new Model will replace the old one.

Parameters
in_modelthe Model to attach to this View
HPS::View& HPS::View::ComputeFitWorldCamera ( HPS::CameraKit out_camera)

This method computes a camera to fit the extents of the scene.

HPS::View& HPS::View::ComputeFitWorldCamera ( SegmentKey const &  in_segment,
HPS::CameraKit out_camera 
)

This method computes a camera to fit the extents of a segment.

Parameters
in_segmentThe segment used to calculate the new camera.
HPS::View& HPS::View::ComputeFitWorldCamera ( BoundingKit const &  in_bounding,
HPS::CameraKit out_camera 
)

This method computes a camera to fit a bounding.

Parameters
in_boundingThe bounding used to calculate the new camera.
HPS::View& HPS::View::ComputeFitWorldCamera ( SegmentKey const &  in_segment,
MatrixKit const &  in_transform,
HPS::CameraKit out_camera 
)

This method computes a camera to fit the extents of a segment.

Parameters
in_segmentThe segment used to calculate the new camera.
in_transformAn optional transform to apply to the segment bounding used to compute the camera. This can be used to ensure that the camera is looking at the geometry in the correct position once any modelling matrices are applied.
HPS::View& HPS::View::ComputeFitWorldCamera ( BoundingKit const &  in_bounding,
MatrixKit const &  in_transform,
HPS::CameraKit out_camera 
)

This method computes a camera to fit a bounding.

Parameters
in_boundingThe bounding used to calculate the new camera.
in_transformAn optional transform to apply to the bounding used to compute the camera. This can be used to ensure that the camera is looking at the geometry in the correct position once any modelling matrices are applied.
void HPS::View::Delete ( )

Deletes this View. If the View has a Model attached, the Model will not be destroyed.

void HPS::View::DetachModel ( )

Detaches the Model from this View

HPS::View& HPS::View::FitWorld ( )

This method automatically adjusts the camera to fit the extents of the scene.

HPS::View& HPS::View::FitWorld ( SegmentKey const &  in_segment)

This method automatically adjusts the camera to fit the extents of a segment.

Parameters
in_segmentThe segment used to calculate the new camera.
HPS::View& HPS::View::FitWorld ( BoundingKit const &  in_bounding)

This method automatically adjusts the camera to fit a bounding.

Parameters
in_boundingThe bounding used to calculate the new camera.
HPS::View& HPS::View::FitWorld ( SegmentKey const &  in_segment,
MatrixKit const &  in_transform 
)

This method automatically adjusts the camera to fit the extents of a segment.

Parameters
in_segmentThe segment used to calculate the new camera.
in_transformAn optional transform to apply to the segment bounding used to compute the camera. This can be used to ensure that the camera is looking at the geometry in the correct position once any modelling matrices are applied.
HPS::View& HPS::View::FitWorld ( BoundingKit const &  in_bounding,
MatrixKit const &  in_transform 
)

This method automatically adjusts the camera to fit a bounding.

Parameters
in_boundingThe bounding used to calculate the new camera.
in_transformAn optional transform to apply to the bounding used to compute the camera. This can be used to ensure that the camera is looking at the geometry in the correct position once any modelling matrices are applied.
Model HPS::View::GetAttachedModel ( ) const

Returns the Model that is attached to this View

IncludeKey HPS::View::GetAttachedModelIncludeLink ( ) const

Returns the IncludeKey associated with this View. The include key links the View with the Model.

AxisTriadControl HPS::View::GetAxisTriadControl ( )

Gets the AxisTriadControl that is associated with this View.

SegmentKey HPS::View::GetModelOverrideSegmentKey ( )

Returns the model override segment. This segment can be used to change attributes affecting the whole model, without affecting the static tree set at the model level.

UTF8 HPS::View::GetName ( ) const

Get the name used when creating this View.

NavigationCubeControl HPS::View::GetNavigationCubeControl ( )

Gets the NavigationCubeControl that is associated with this View.

KeyArray const HPS::View::GetNavigationKeys ( )

Gets an array of Keys associated with the Axis Triad and Navigation Cube for this View

OperatorControl HPS::View::GetOperatorControl ( )

Gets the OperatorControl that is associated with this View.

OperatorPtrArray HPS::View::GetOperators ( ) const

Gets an array of all operators currently active on this View.

LayoutArray HPS::View::GetOwningLayouts ( )

Returns an array containing the Layouts this View is included in.

PortfolioKey HPS::View::GetPortfolioKey ( )

Returns the HPS::PortfolioKey associated with this View.

Rendering::Mode HPS::View::GetRenderingMode ( ) const

Gets the rendering mode for this View. A rendering modes enable things like "hidden line" rendering or a particular lighting interpolation algorithm.

SegmentKey HPS::View::GetSegmentKey ( )

Each of the four display hierarchy objects (HPS::Canvas, HPS::Layout, HPS::View, HPS::Model) are backed by a HPS::SegmentKey. This function returns the HPS::SegmentKey that is associated with this View.

bool HPS::View::GetSimpleReflection ( )

Returns the status of the simple reflection

bool HPS::View::GetSimpleShadow ( )

Returns the status of the simple shadows

HPS::Type HPS::View::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared. This does not necessarily give the true type of the underlying object.

Returns
The declared type of the object in question, which may differ from the true, underlying type.

Reimplemented from HPS::Object.

void HPS::View::SetOperator ( OperatorPtr const &  in_operator)

Makes an operator active on this View. Assumes control of the memory of the operator.

Parameters
in_operatorthe operator to be made active on this View.
void HPS::View::SetOperator ( Operator in_operator)

Makes an operator active on this View. Assumes control of the memory of the operator.

Parameters
in_operatorthe operator to be made active on this View.
void HPS::View::SetOperators ( OperatorPtrArray &  in_operators)

Makes a set of operators active on this View.

Parameters
in_operatorsthe set of operators to be made active on this View
void HPS::View::SetOperators ( size_t  in_count,
OperatorPtr  in_operators[] 
)

Makes an array of operators active on this View.

Parameters
in_countthe number of operators in the in_operators array
in_operatorsthe array of operators to be made active on this View
void HPS::View::SetRenderingMode ( Rendering::Mode  in_mode)

Sets the rendering mode for this View. A rendering modes enable things like "hidden line" rendering or a particular lighting interpolation algorithm.

See also
Programming Guide section 1.1.3.
void HPS::View::SetSimpleReflection ( bool  in_state,
float  in_percent_offset = 5.0f 
)

Turns simple reflection on or off, automatically calculating reflection plane and light direction

Parameters
in_statecontrols whether simple reflection is on or off
in_percent_offsetdistance to add between the model's bounding box and the position of the reflection plane If not specified, it is set to 5%.
void HPS::View::SetSimpleShadow ( bool  in_state,
float  in_percent_offset = 5.0f 
)

Turns simple shadows on or off, automatically calculating shadow plane and light direction

Parameters
in_statecontrols whether simple shadows are on or off
in_percent_offsetdistance to add between the model's bounding box and the position of the shadow plane If not specified, it is set to 5%.
void HPS::View::SmoothTransition ( HPS::CameraKit const &  in_camera_kit,
HPS::Time  in_duration = 0.5 
)

Smoothly moves the camera from the current position to the one specified by the user.

Parameters
in_camera_kita camera kit describing the destination camera
in_durationthe duration of the animation, specified in seconds. Defaults to 0.5 seconds.
void HPS::View::Update ( HPS::Sprocket::UpdateType  in_update_type = Sprocket::UpdateType::Asynchronous) const

Redraws the Model in this View.

void HPS::View::Update ( HPS::Window::UpdateControl const  in_control,
HPS::Time const  time_limit = -1. 
) const

Redraws the Model in this View using parameters that you specify.

Parameters
in_controlone of the enum values specified by HPS::Window::UpdateControl
time_limitthe maximum amount of time, in seconds, to spend updating this View

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