Class IVisualization

Inheritance Relationships

Derived Types

Class Documentation

class Acts::IVisualization

Partially abstract base class which provides an interface to visualization helper classes.

It provides a number of methods that all the helpers need to conform to. It also provides a ColorType typedef, but not all of the helpers actually support that.

Subclassed by Acts::ObjVisualization< T >, Acts::PlyVisualization< T >

Public Types

using ColorType = std::array<int, 3>

The color typedef.

It’s an array of three numbers [0, 255] indicating RGB color values.

using FaceType = std::vector<size_t>

The face type.

Public Functions

void clear() = 0

Remove all contents of this helper.

void face(const std::vector<Vector3D> &vtxs, ColorType color = {120, 120, 120}) = 0

Draw a face that connects a list of vertices.

Note

Depending on the helper implementation, out of plane vertices might be handled differently.

Parameters
  • vtxs: The vertices that make up the face

  • color: The color of the face

void face(const std::vector<Vector3F> &vtxs, ColorType color = {120, 120, 120})
void faces(const std::vector<Vector3D> &vtxs, const std::vector<FaceType> &faces, ColorType color = {120, 120, 120}) = 0

Draw a faces that connects a list of vertices - expert only.

Note

Depending on the helper implementation, out of plane vertices might be handled differently.

Parameters
  • vtxs: The vertices that make up the faceS

  • faces: The face presectiotions (i.e. connecting vertices)

  • color: The color of the face

void line(const Vector3D &a, const Vector3D &b, ColorType color = {120, 120, 120}) = 0

Draw a line from a vertex to another.

Parameters
  • a: The start vertex

  • b: The end vertex

  • color: The color of the line

void line(const Vector3F &a, const Vector3F &b, ColorType color = {120, 120, 120})
void vertex(const Vector3D &vtx, ColorType color = {120, 120, 120}) = 0

Draw a vertex at a given location and a color.

Parameters
  • vtx: The vertex position

  • color: The color

void vertex(const Vector3F &vtx, ColorType color = {120, 120, 120})

Below are helper functions, which share the same interface as the ones above, but explicitly accept float values (instead of double), converts them and calls the above methods.

Draw a vertex at a given location and a color.

Parameters
  • vtx: The vertex position

  • color: The color

void write(std::ostream &os) const = 0

Write the content of the helper to an outstream.

Parameters
  • os: The output stream for file

void write(const std::string &path) const = 0

Write the content of the helper to an outstream.

Note

wil change to std::filesystem::path once gcc9 is standard

Parameters
  • path: is the file system path for writing the file

Protected Functions

bool hasExtension(const std::string &path) const

Helper: check for extension.

Note

this is a placeholder for std::filesystem::has_extension which needs special linking until gcc9

Parameters
  • path: the path to be checked

void replaceExtension(std::string &path, const std::string &suffix) const

Helper: replace the extension.

Note

this is a placeholder for std::filesystem::replace_extension which needs special linking until gcc9

Parameters
  • path: [in,out] the path to be changed

  • suffix: the extension to be added