CGAL 6.0.1 - CGAL Basic Viewer
Loading...
Searching...
No Matches
CGAL::Graphics_scene Class Reference

#include <CGAL/Graphics_scene.h>

Definition

The class Graphics_scene stores points, segments, triangles, rays, and lines.

Elements can be added, possibly with associated colors. Non triangular faces can be directly added and are triangulated internally.

Examples
Basic_viewer/draw_mesh_and_points.cpp, Basic_viewer/draw_several_windows.cpp, and Basic_viewer/draw_surface_mesh_small_faces.cpp.

Public Member Functions

template<typename KPoint >
void add_point (const KPoint &p)
 adds the given point in the scene.
 
template<typename KPoint >
void add_point (const KPoint &p, const CGAL::IO::Color &color)
 adds the given colored point in the scene.
 
template<typename KPoint >
void add_segment (const KPoint &p1, const KPoint &p2)
 adds the given segment in the scene.
 
template<typename KPoint >
void add_segment (const KPoint &p1, const KPoint &p2, const CGAL::IO::Color &color)
 adds the given colored segment in the scene.
 
template<typename KPoint , typename KVector >
void add_ray (const KPoint &p, const KVector &v)
 adds the given ray in the scene: a half line starting from p and having v as direction.
 
template<typename KPoint , typename KVector >
void add_ray (const KPoint &p, const KVector &v, const CGAL::IO::Color &color)
 adds the given colored ray in the scene: a half line starting from p and having v as direction.
 
template<typename KPoint , typename KVector >
void add_line (const KPoint &p, const KVector &v)
 adds the given line in the scene, defined by p and v as direction.
 
template<typename KPoint , typename KVector >
void add_line (const KPoint &p, const KVector &v, const CGAL::IO::Color &color)
 adds the given colored line in the scene, defined by p and v as direction.
 
void face_begin ()
 starts a new face.
 
void face_begin (const CGAL::IO::Color &color)
 starts a new colored face.
 
bool a_face_started () const
 return true iff a face is started.
 
template<typename KPoint >
bool add_point_in_face (const KPoint &kp)
 adds the given point in the current face.
 
template<typename KPoint , typename KVector >
bool add_point_in_face (const KPoint &kp, const KVector &p_normal)
 adds the given point in the current face, having the vertex normal.
 
void face_end ()
 ends the current face.
 
template<typename KPoint >
void add_text (const KPoint &kp, const char *txt)
 adds the given text at the given position in the scene.
 
template<typename KPoint >
void add_text (const KPoint &kp, const std::string &txt)
 adds the given text at the given position in the scene.
 
bool empty () const
 returns true iff the scene has no element.
 
void clear ()
 clears the scene, i.e., removes all points, segments, triangles, and text.
 
const CGAL::Bbox_3bounding_box () const
 returns the bounding box of all the elements in the scene.
 
bool is_two_dimensional () const
 returns true if the scene is in 2D, i.e., lies on the XY or XZ or YZ plane.
 

Member Function Documentation

◆ add_line() [1/2]

template<typename KPoint , typename KVector >
void CGAL::Graphics_scene::add_line ( const KPoint &  p,
const KVector &  v 
)

adds the given line in the scene, defined by p and v as direction.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.
KVectora model of Kernel::Vector_2 or Kernel::Vector_3.

◆ add_line() [2/2]

template<typename KPoint , typename KVector >
void CGAL::Graphics_scene::add_line ( const KPoint &  p,
const KVector &  v,
const CGAL::IO::Color &  color 
)

adds the given colored line in the scene, defined by p and v as direction.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.
KVectora model of Kernel::Vector_2 or Kernel::Vector_3.

◆ add_point() [1/2]

template<typename KPoint >
void CGAL::Graphics_scene::add_point ( const KPoint &  p)

adds the given point in the scene.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.

◆ add_point() [2/2]

template<typename KPoint >
void CGAL::Graphics_scene::add_point ( const KPoint &  p,
const CGAL::IO::Color &  color 
)

adds the given colored point in the scene.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.

◆ add_point_in_face() [1/2]

template<typename KPoint >
bool CGAL::Graphics_scene::add_point_in_face ( const KPoint &  kp)

adds the given point in the current face.

Precondition
a_face_started()
Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.

◆ add_point_in_face() [2/2]

template<typename KPoint , typename KVector >
bool CGAL::Graphics_scene::add_point_in_face ( const KPoint &  kp,
const KVector &  p_normal 
)

adds the given point in the current face, having the vertex normal.

Precondition
a_face_started()
Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.
KVectora model of Kernel::Vector_2 or Kernel::Vector_3.

◆ add_ray() [1/2]

template<typename KPoint , typename KVector >
void CGAL::Graphics_scene::add_ray ( const KPoint &  p,
const KVector &  v 
)

adds the given ray in the scene: a half line starting from p and having v as direction.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.
KVectora model of Kernel::Vector_2 or Kernel::Vector_3.

◆ add_ray() [2/2]

template<typename KPoint , typename KVector >
void CGAL::Graphics_scene::add_ray ( const KPoint &  p,
const KVector &  v,
const CGAL::IO::Color &  color 
)

adds the given colored ray in the scene: a half line starting from p and having v as direction.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.
KVectora model of Kernel::Vector_2 or Kernel::Vector_3.

◆ add_segment() [1/2]

template<typename KPoint >
void CGAL::Graphics_scene::add_segment ( const KPoint &  p1,
const KPoint &  p2 
)

adds the given segment in the scene.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.

◆ add_segment() [2/2]

template<typename KPoint >
void CGAL::Graphics_scene::add_segment ( const KPoint &  p1,
const KPoint &  p2,
const CGAL::IO::Color &  color 
)

adds the given colored segment in the scene.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.

◆ add_text() [1/2]

template<typename KPoint >
void CGAL::Graphics_scene::add_text ( const KPoint &  kp,
const char *  txt 
)

adds the given text at the given position in the scene.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.

◆ add_text() [2/2]

template<typename KPoint >
void CGAL::Graphics_scene::add_text ( const KPoint &  kp,
const std::string &  txt 
)

adds the given text at the given position in the scene.

Template Parameters
KPointa model of Kernel::Point_2, Kernel::Point_3, Kernel::WeightedPoint_2 or Kernel::WeightedPoint_3.

◆ face_end()

void CGAL::Graphics_scene::face_end ( )

ends the current face.

Precondition
a_face_started()