|
cgv
|
A vector with zero based index. More...
#include <fvec.h>
Public Types | |
| enum | { dims = N } |
| compile-time constant indicating the dimensionality of the vector More... | |
| typedef T | value_type |
| typedef T & | reference |
| typedef const T & | const_reference |
| typedef std::size_t | size_type |
| typedef std::ptrdiff_t | difference_type |
| typedef T * | pointer |
| typedef const T * | const_pointer |
| typedef T * | iterator |
| typedef const T * | const_iterator |
| typedef std::reverse_iterator< iterator > | reverse_iterator |
| typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Public Member Functions | |
| fvec () | |
| create an uninitialized vector | |
| fvec (const T &a) | |
| create a vector where all N components are initialized to the constant value a | |
| int int S2 | fvec (const fvec< S1, N - 1 > &other, S2 s) |
| template<typename S > | |
| fvec (const fvec< S, N+1 > &other) | |
| construct from vector of one dimension higher by dropping the highest dimension | |
| fvec (const std::array< T, N > &arr) | |
| construct from std::array of same size | |
| void | assign (const std::array< T, N > &arr) |
| set to the contents of the given std::array with same size | |
| int int N | lift () const |
| vec< T > | to_vec () const |
| conversion to vector type | |
| T & | x () |
| return first component | |
| const T & | x () const |
| return first component | |
| T & | y () |
| return second component | |
| const T & | y () const |
| return second component | |
| T & | z () |
| return third component | |
| const T & | z () const |
| return third component | |
| T & | w () |
| return fourth component | |
| const T & | w () const |
| return fourth component | |
| T & | operator[] (int i) |
| return a reference to the component at specified index i | |
| const T & | operator[] (int i) const |
| return a reference to the component at specified index i | |
| T & | operator() (int i) |
| return a reference to the component at specified index i | |
| const T & | operator() (int i) const |
| return a reference to the component at specified index i | |
| T * | data () |
| return a pointer to the underlying array serving as component storage | |
| const T * | data () const |
| return a pointer to the underlying array serving as component storage | |
| iterator | begin () |
| return an iterator to the first component of *this | |
| iterator | end () |
| return an iterator past the last component of *this | |
| const_iterator | begin () const |
| return an iterator to the first component of *this | |
| const_iterator | end () const |
| return an iterator past the last component of *this | |
| reverse_iterator | rbegin () |
| return a reverse iterator to the first component of the reversed *this that corresponds to the last component of the non-reversed *this | |
| reverse_iterator | rend () |
| return a reverse iterator past the last component of the reversed *this that corresponds to the component preceding the first component of the non-reversed *this | |
| const_reverse_iterator | rbegin () const |
| return a reverse iterator to the first component of the reversed *this that corresponds to the last component of the non-reversed *this | |
| const_reverse_iterator | rend () const |
| return a reverse iterator past the last component of the reversed *this that corresponds to the component preceding the first component of the non-reversed *this | |
| fvec< T, N > & | operator+= (const T &s) |
| in place addition of a scalar s | |
| fvec< T, N > & | operator-= (const T &s) |
| in place subtraction by scalar s | |
| fvec< T, N > & | operator*= (const T &s) |
| in place multiplication with s | |
| fvec< T, N > & | operator/= (const T &s) |
| in place division by scalar s | |
| template<typename S > | |
| fvec< T, N > & | operator+= (const fvec< S, N > &v) |
| in place vector addition | |
| template<typename S > | |
| fvec< T, N > & | operator-= (const fvec< S, N > &v) |
| in place vector subtraction | |
| template<typename S > | |
| fvec< T, N > & | operator*= (const fvec< S, N > &v) |
| in place componentwise vector multiplication | |
| template<typename S > | |
| fvec< T, N > & | operator/= (const fvec< S, N > &v) |
| in place componentwise vector division | |
| template<typename S > | |
| fvec< T, N > | operator+ (const fvec< S, N > &v) const |
| vector addition | |
| template<typename S > | |
| fvec< T, N > | operator- (const fvec< S, N > &v) const |
| vector subtraction | |
| template<typename S > | |
| fvec< T, N > | operator* (const fvec< S, N > &v) const |
| componentwise vector multiplication | |
| template<typename S > | |
| fvec< T, N > | operator/ (const fvec< S, N > &v) const |
| componentwise vector division | |
| fvec< T, N > | operator+ (const T &s) const |
| componentwise addition of scalar | |
| fvec< T, N > | operator- (const T &s) const |
| componentwise subtraction of scalar | |
| fvec< T, N > | operator* (const T &s) const |
| multiplication with scalar s | |
| fvec< T, N > | operator/ (const T &s) const |
| divide vector by scalar s | |
| fvec< T, N > | operator- () const |
| negate the vector | |
| template<typename S > | |
| bool | operator== (const fvec< S, N > &v) const |
| test for equality | |
| template<typename S > | |
| bool | operator!= (const fvec< S, N > &v) const |
| test for inequality | |
| T | sqr_length () const |
| square length of vector | |
| T | length () const |
| length of the vector L2-Norm | |
| void | sign () |
| componentwise sign values | |
| void | step (const fvec< T, N > &r) |
| componentwise sign values | |
| void | abs () |
| componentwise absolute values | |
| void | ceil () |
| ceil componentwise | |
| void | floor () |
| floor componentwise | |
| void | round () |
| round componentwise | |
| T | normalize () |
| normalize the vector using the L2-Norm and return the length | |
| T | safe_normalize () |
| normalize the vector using the L2-Norm and return the length; if length is zero the vector remains unchanged | |
Static Public Member Functions | |
| static fvec< T, N > | zeroh () |
| constuct a homogeneous zero-vector (yields same result as calling fvec<T, N-1>(0).lift() but is faster) | |
| static fvec< T, N > | from_vec (const vec< T > &) |
| conversion from vector | |
| static cgv::type::uint32_type | size () |
| return number of components | |
Protected Attributes | |
| T | v [N] |
A vector with zero based index.
| typedef const T* cgv::math::fvec< T, N >::const_iterator |
| typedef const T* cgv::math::fvec< T, N >::const_pointer |
| typedef const T& cgv::math::fvec< T, N >::const_reference |
| typedef std::reverse_iterator<const_iterator> cgv::math::fvec< T, N >::const_reverse_iterator |
| typedef std::ptrdiff_t cgv::math::fvec< T, N >::difference_type |
| typedef T* cgv::math::fvec< T, N >::iterator |
| typedef T* cgv::math::fvec< T, N >::pointer |
| typedef T& cgv::math::fvec< T, N >::reference |
| typedef std::reverse_iterator<iterator> cgv::math::fvec< T, N >::reverse_iterator |
| typedef std::size_t cgv::math::fvec< T, N >::size_type |
| typedef T cgv::math::fvec< T, N >::value_type |
| anonymous enum |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
return an iterator to the first component of *this
Definition at line 165 of file fvec.h.
Referenced by cgv::math::fvec< T, N >::rend(), cgv::math::fvec< T, N >::rend(), and cgv::render::clod_point_renderer::set_points().
|
inline |
|
inline |
|
inline |
return a pointer to the underlying array serving as component storage
Definition at line 157 of file fvec.h.
Referenced by cgv::render::gl::gl_transparent_renderer::blend_texture_over_viewport(), cgv::audio::OALListener::get_orientation(), cgv::audio::OALListener::get_position(), cgv::audio::OALSource::get_position(), cgv::audio::OALListener::get_velocity(), cgv::audio::OALSource::get_velocity(), vr::get_world_to_eye_transform(), cgv::audio::OALListener::set_position(), cgv::audio::OALSource::set_position(), cgv::audio::OALListener::set_velocity(), and cgv::audio::OALSource::set_velocity().
|
inline |
|
inline |
return an iterator past the last component of *this
Definition at line 167 of file fvec.h.
Referenced by cgv::math::fvec< T, N >::rbegin(), and cgv::math::fvec< T, N >::rbegin().
|
inline |
|
inline |
|
static |
conversion from vector
Definition at line 703 of file fvec.h.
References cgv::math::vec< T >::dim().
|
inline |
length of the vector L2-Norm
Definition at line 254 of file fvec.h.
References cgv::math::fvec< T, N >::sqr_length().
Referenced by cgv::media::mesh::dual_contouring< X, T >::compute_cell_vertex(), cgv::media::mesh::simple_mesh< T >::compute_face_normal(), cgv::math::quaternion< T >::exp(), cgv::render::gl::gl_implicit_surface_drawable_base::extract_mesh(), cgv::math::quaternion< T >::log(), cgv::math::fvec< T, N >::normalize(), cgv::render::view::rotate(), cgv::math::fvec< T, N >::safe_normalize(), cgv::render::view::set_eye_keep_extent(), and cgv::render::view::set_eye_keep_view_angle().
|
inline |
|
inline |
normalize the vector using the L2-Norm and return the length
Definition at line 290 of file fvec.h.
References cgv::math::fvec< T, N >::length().
Referenced by cgv::render::gl::gl_implicit_surface_drawable_base::compute_face_normal(), cgv::media::mesh::convex_polyhedron< T, TCDim >::compute_face_plane(), cgv::media::mesh::simple_mesh< T >::compute_face_tangents(), cgv::media::mesh::simple_mesh< T >::compute_vertex_normals(), cgv::media::mesh::simple_mesh< T >::dual(), cgv::media::mesh::simple_mesh< T >::gyro(), cgv::media::mesh::simple_mesh< T >::join(), cgv::render::gl::gl_implicit_surface_drawable_base::new_vertex(), cgv::math::quaternion< T >::put_axis(), cgv::render::view::put_coordinate_system(), cgv::gui::vr_calibration::read_calibration(), and cgv::gui::vr_calibration::update_driver_calibration().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
return a reverse iterator to the first component of the reversed *this that corresponds to the last component of the non-reversed *this
Definition at line 173 of file fvec.h.
References cgv::math::fvec< T, N >::end().
|
inline |
return a reverse iterator to the first component of the reversed *this that corresponds to the last component of the non-reversed *this
Definition at line 177 of file fvec.h.
References cgv::math::fvec< T, N >::end().
|
inline |
return a reverse iterator past the last component of the reversed *this that corresponds to the component preceding the first component of the non-reversed *this
Definition at line 175 of file fvec.h.
References cgv::math::fvec< T, N >::begin().
|
inline |
return a reverse iterator past the last component of the reversed *this that corresponds to the component preceding the first component of the non-reversed *this
Definition at line 179 of file fvec.h.
References cgv::math::fvec< T, N >::begin().
|
inline |
|
inline |
normalize the vector using the L2-Norm and return the length; if length is zero the vector remains unchanged
Definition at line 298 of file fvec.h.
References cgv::math::fvec< T, N >::length().
|
inline |
|
inlinestatic |
return number of components
Definition at line 131 of file fvec.h.
Referenced by cgv::render::gl::gl_implicit_surface_drawable_base::compute_face_normal(), cgv::app::overlay::get_local_rectangle(), cgv::app::navigator::handle_mouse_event(), cgv::app::color_map_editor::init_frame(), cgv::render::gl::gl_implicit_surface_drawable_base::new_polygon(), and cgv::plot::plot_base::set_plot_uniforms().
|
inline |
square length of vector
Definition at line 247 of file fvec.h.
Referenced by cgv::math::distorted_pinhole< T >::invert_distortion_model(), and cgv::math::fvec< T, N >::length().
|
inline |
| vec< T > cgv::math::fvec< T, N >::to_vec | ( | ) | const |
conversion to vector type
Definition at line 695 of file fvec.h.
References cgv::math::vec< T >::set_extern_data().
Referenced by cgv::media::mesh::dual_contouring< X, T >::compute_cell_vertex(), cgv::render::gl::gl_implicit_surface_drawable_base::draw(), cgv::render::gl::gl_implicit_surface_drawable_base::new_vertex(), cgv::media::mesh::dual_contouring< X, T >::process_edge_plane(), and cgv::media::mesh::cuberille< X, T, P >::process_slice().
|
inline |
return fourth component
Definition at line 145 of file fvec.h.
Referenced by cgv::math::quaternion< T >::affin(), cgv::app::gizmo::handle(), cgv::app::navigator::handle_mouse_event(), cgv::math::quaternion< T >::operator*=(), and cgv::math::ray< T, 3 >::ray().
|
inline |
|
inline |
return first component
Definition at line 133 of file fvec.h.
Referenced by cgv::math::quaternion< T >::affin(), cgv::media::mesh::simple_mesh< T >::compute_face_tangents(), cgv::render::managed_frame_buffer::ensure(), cgv::render::context::get_gamma(), cgv::app::navigator::handle_mouse_event(), cgv::app::color_selector::handle_mouse_event(), cgv::app::color_selector::init_frame(), cgv::math::quaternion< T >::operator*=(), cgv::math::quaternion< T >::put_im(), cgv::math::ray< T, 3 >::ray(), cgv::math::quaternion< T >::set(), cgv::math::quaternion< T >::set_normal(), and cgv::app::overlay::update_layout().
|
inline |
|
inline |
return second component
Definition at line 137 of file fvec.h.
Referenced by cgv::math::quaternion< T >::affin(), cgv::media::mesh::simple_mesh< T >::compute_face_tangents(), cgv::render::managed_frame_buffer::ensure(), cgv::render::context::get_gamma(), cgv::app::gizmo::handle(), cgv::app::color_map_legend::handle_member_change(), cgv::app::performance_monitor::handle_member_change(), cgv::app::navigator::handle_mouse_event(), cgv::math::quaternion< T >::operator*=(), cgv::math::quaternion< T >::put_im(), cgv::math::ray< T, 3 >::ray(), cgv::math::quaternion< T >::set(), cgv::math::quaternion< T >::set_normal(), and cgv::app::overlay::update_layout().
|
inline |
|
inline |
return third component
Definition at line 141 of file fvec.h.
Referenced by cgv::math::quaternion< T >::affin(), cgv::media::mesh::simple_mesh< T >::compute_face_tangents(), cgv::render::context::get_gamma(), cgv::app::gizmo::handle(), cgv::app::navigator::handle_mouse_event(), cgv::math::quaternion< T >::operator*=(), cgv::math::quaternion< T >::put_im(), cgv::math::quaternion< T >::set(), and cgv::math::quaternion< T >::set_normal().
|
inline |
|
inlinestatic |
|
protected |