Shiokaze Framework
A research-oriented fluid solver for computer graphics
camera3_interface Class Referenceabstract

Interface for 3D camera manipulations. More...

#include <camera3_interface.h>

Inheritance diagram for camera3_interface:
recursive_configurable_module UI_interface recursive_configurable module configurable credit messageable

Public Member Functions

virtual void set_bounding_box (const double *p0, const double *p1)=0
 Set a bounding box. More...
 
virtual void look_at (const double *target, const double *position, const double *up, double fov)=0
 Set up a camera with a target position, origin position, fov and others. More...
 
virtual void get (double *target, double *position, double *up, double *fov) const =0
 Get camera information about the target position, origin position, fov and others. More...
 
void look_at (const double *target)
 Set up a camera with a target position. More...
 
void look_from (const double *target, const double *direction, double distance, const double *up, double fov, double near, double far)
 Set up a camera with a target position, origin position and fov. More...
 
void set_distance (double distance)
 Change the distance of camera from the target position. More...
 
double get_distance () const
 Get the distance of camera from the target position. More...
 
void set_fov (double fov)
 Change the field of view. More...
 
virtual UI_interface::event_structure convert (const UI_interface::event_structure &event) const =0
 Convert event. More...
 
- Public Member Functions inherited from recursive_configurable_module
virtual void recursive_load (configuration &config) override
 Start recursively load configurables. More...
 
virtual void recursive_configure (configuration &config) override
 Recursively call configure. More...
 
- Public Member Functions inherited from recursive_configurable
 recursive_configurable ()=default
 Default constructor.
 
virtual void recursive_initialize (const configurable::environment_map &environment=configurable::environment_map())
 Initialize the program itself and relay the same to its children. Used to get things ready for actual use. More...
 
virtual bool is_ready () const
 Get if the instance is initialized. More...
 
virtual void add_child (configurable *child)
 Add a child instance. More...
 
virtual void add_child (recursive_configurable *child)
 Add a child instance. More...
 
virtual void remove_child (configurable *child)
 Remove a child instance. More...
 
virtual void remove_child (recursive_configurable *child)
 Remove a child instance. More...
 
virtual void setup_now (configuration &config=get_global_configuration()) override
 Run recursive_load - recursive_configure - recursive_initialize processes.
 
virtual bool not_recursive () override
 Check if this instance is not derived from recursive_configurable. More...
 
void set_environment (std::string name, const void *value)
 Set the pointer to an environmental value associated with an input name. More...
 
- Public Member Functions inherited from configurable
virtual void load (configuration &config)
 Load the program. Used to load files and libraries into memory. More...
 
virtual void configure (configuration &config)
 Configure the program. Used to load and set parameters. More...
 
- Public Member Functions inherited from module
 module ()
 Default constructor for module.
 
virtual ~module ()
 Default destructor for module.
 
virtual std::string get_module_name () const
 Get the module name. More...
 
- Public Member Functions inherited from credit
 credit ()=default
 Default constructor.
 
 credit (std::string name, std::string argument_name)
 Constructor for credit. More...
 
virtual void set_name (std::string name, std::string argument_name="")
 Set name (and perhaps, argument name together) More...
 
virtual std::string get_name () const
 Get the name.
 
virtual void set_argument_name (std::string argument_name)
 Set an argument name. More...
 
virtual std::string get_argument_name () const
 Get an argument name. More...
 
virtual double get_version () const
 Get version. More...
 
virtual std::string get_author () const
 Get author's name. More...
 
virtual std::tuple< int, int, int > get_date () const
 Get currently set date. More...
 
virtual std::string get_email_address () const
 Get email address. More...
 
- Public Member Functions inherited from messageable
virtual bool send_message (std::string message, void *ptr=nullptr)
 Send a message. More...
 
virtual bool const_send_message (std::string message, void *ptr=nullptr) const
 Send a message. More...
 
- Public Member Functions inherited from UI_interface
virtual bool handle_event (const event_structure &event)
 
virtual bool relay_event (const event_structure &event) const
 Get if the event shoule be relayed to other instances after handle_event of this instance is called. More...
 
virtual CURSOR_TYPE get_current_cursor () const
 Get current cursor icon. More...
 

Additional Inherited Members

- Public Types inherited from configurable
using environment_map = std::map< std::string, const void * >
 Type for environment_map.
 
- Public Types inherited from UI_interface
enum  ACTION { RELEASE = 0, PRESS = 1, REPEAT = 2 }
 Key and mose action type. More...
 
enum  MODIFIER {
  MOD_SHIFT = 0x0001, MOD_CONTROL = 0x0002, MOD_ALT = 0x0004, MOD_SUPER = 0x0008,
  MOD_CAPS_LOCK = 0x0010, MOD_NUM_LOCK = 0x0020
}
 Modifier bits. More...
 
enum  MOUSE_BUTTON { LEFT = 1, RIGHT = 2, MIDDLE = 3 }
 Mouse button type. More...
 
enum  CURSOR_TYPE {
  ARROW_CURSOR = 0, HAND_CURSOR = 1, IBEAM_CURSOR = 2, CROSSHAIR_CURSOR = 3,
  HRESIZE_CURSOR = 4, VRESIZE_CURSOR = 5
}
 Cursor icon type. More...
 
- Static Public Member Functions inherited from configurable
static configurationset_global_configuration (const configuration &config)
 Assign the global settings of the program. More...
 
static configurationget_global_configuration ()
 Get the global settings of the program. More...
 
template<class T >
static const T & get_env (const environment_map &environment, std::string key)
 Extract an specified type of pointer from the input environment. More...
 
- Static Public Member Functions inherited from module
static std::string module_libpath (std::string module_name)
 Get the path to the dynamic library. e.g., "mylib" -> "symlink-public/lib/libshiokaze_mylib.dylib". More...
 
static modulealloc_module (configuration &config, std::string arg_name, std::string default_module_name, std::string description)
 Automatically reads the parameter "arg_name" to fetch the name for the library, and allocate the library. More...
 
static modulealloc_module (std::string path)
 Reads the dynamic library of a class module, allocate, and return the pointer to it. More...
 
static unsigned close_all_handles ()
 Close all the handles that are still unloaded. More...
 
template<class T >
static std::unique_ptr< T > unique_alloc_module (configuration &config, std::string arg_name, std::string default_module_name, std::string description)
 Allocate the module and cast to the a specified class T. More...
 
static unsigned count_open_modules ()
 Count all the open modules. More...
 
- Static Public Member Functions inherited from UI_interface
static bool has_graphical_interface ()
 Get if a graphical interface is available. More...
 
- Protected Member Functions inherited from configurable
bool check_set (const environment_map &environment, std::vector< std::string > names)
 Check if the values for a variable keys exist. More...
 
- Protected Member Functions inherited from UI_interface
virtual void resize (int width, int height)
 Function that catches window resizing events. More...
 
virtual void draw (graphics_engine &g) const
 Function that catches draw event. More...
 
virtual bool keyboard (int key, int action, int mods)
 Function that catches key down event. More...
 
virtual void cursor (double x, double y, double z)
 Function that catches passive cursor event. More...
 
virtual void mouse (double x, double y, double z, int button, int action, int mods)
 Function that catches mouse event. More...
 
virtual void scroll (double xoffset, double yoffset)
 Function that catches scroll event. More...
 
virtual void drag (double x, double y, double z, double u, double v, double w)
 Function that catches drag event. More...
 
- Protected Attributes inherited from credit
std::string m_name
 Name of credit.
 
std::string m_argument_name
 Argument name.
 

Detailed Description

Interface for 3D camera manipulations.

Member Function Documentation

◆ convert()

virtual UI_interface::event_structure camera3_interface::convert ( const UI_interface::event_structure event) const
pure virtual

Convert event.

Parameters
[in]eventinput raw event information.
Returns
information with physical coordinate position.

◆ get()

virtual void camera3_interface::get ( double *  target,
double *  position,
double *  up,
double *  fov 
) const
pure virtual

Get camera information about the target position, origin position, fov and others.

Parameters
[out]targetTarget position.
[out]positionCamera position.
[out]upTop unit vector.
[out]fovField of view.

◆ get_distance()

double camera3_interface::get_distance ( ) const
inline

Get the distance of camera from the target position.

Returns
Distance from the target to the camera.

◆ look_at() [1/2]

void camera3_interface::look_at ( const double *  target)
inline

Set up a camera with a target position.

Parameters
[in]targetTarget position.

◆ look_at() [2/2]

virtual void camera3_interface::look_at ( const double *  target,
const double *  position,
const double *  up,
double  fov 
)
pure virtual

Set up a camera with a target position, origin position, fov and others.

Parameters
[in]targetTarget position.
[in]positionCamera position.
[in]upTop unit vector.
[in]fovField of view.

◆ look_from()

void camera3_interface::look_from ( const double *  target,
const double *  direction,
double  distance,
const double *  up,
double  fov,
double  near,
double  far 
)
inline

Set up a camera with a target position, origin position and fov.

Parameters
[in]targetTarget position.
[in]directionDirection from the target position. (unit vector)
[in]distanceDistance from the camera.
[in]upTop unit vector.
[in]fovField of view.
[in]nearNear clip view.
[in]farFar clip view.

◆ set_bounding_box()

virtual void camera3_interface::set_bounding_box ( const double *  p0,
const double *  p1 
)
pure virtual

Set a bounding box.

Parameters
[in]p0Left bottom corner position.
[in]p1Right top corner position.

◆ set_distance()

void camera3_interface::set_distance ( double  distance)
inline

Change the distance of camera from the target position.

Parameters
[in]distanceNew distance.

◆ set_fov()

void camera3_interface::set_fov ( double  fov)
inline

Change the field of view.

Parameters
[in]fovNew field of view.

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