Template Class GenericLine

Inheritance Relationships

Derived Type

Class Documentation

template<int dim>
class GenericLine

class GenericLine. Represents a generic line with vertex VertexType The equation of a linein l=Ax + By + C

Subclassed by bitrl::utils::trajectory::LineSegmentLink< dim, NodeData, SegmentData >

Public Types

typedef GeomPoint<dim> vertex_type

Public Functions

GenericLine()

Constructor.

GenericLine(const vertex_type &p1, const vertex_type &p2)

Constructor.

GenericLine(const vertex_type &p1, const vertex_type &p2, uint_t id)

Constructor.

const vertex_type &get_vertex(uint_t v) const

Returns the v-th vertex of the segment.

vertex_type &get_vertex(uint_t v)

Returns the v-th vertex of the segment.

inline bool has_valid_id() const noexcept

Returns true iff id_ != rlenvscpp::consts::INVALID_ID.

inline uint_t get_id() const noexcept

Returns the id of the line.

inline void set_id(uint_t id) noexcept

Set the id of the line.

real_t slope() const

The slope of the line.

real_t factor() const

Returns the constant factor.

real_t distance(const vertex_type &n) const

Returns the perpendicular distance from the line to the node.

inline real_t length() const

Calculate the length of the line.

real_t distance(const GenericLine<2>::vertex_type &n) const

Public Static Attributes

static const int dimension = dim