INET Framework for OMNeT++/OMNEST
inet::LineSegment Class Reference

This class represents a 3 dimensional line segment between two points. More...

#include <LineSegment.h>

Inheritance diagram for inet::LineSegment:
inet::GeometricObjectBase

Public Member Functions

 LineSegment ()
 
 LineSegment (const Coord &point1, const Coord &point2)
 
const CoordgetPoint1 () const
 
void setPoint1 (const Coord &point1)
 
const CoordgetPoint2 () const
 
void setPoint2 (const Coord &point2)
 
double length () const
 
virtual bool isNil () const override
 Returns true if this geometric object is the same as the unspecified singleton instance of this type. More...
 
virtual bool isUnspecified () const override
 Returns true if this geometric object is not completely specified. More...
 
bool computeIntersection (const LineSegment &lineSegment, Coord &intersection1, Coord &intersection2)
 
- Public Member Functions inherited from inet::GeometricObjectBase
 GeometricObjectBase ()
 
virtual ~GeometricObjectBase ()
 

Static Public Attributes

static const LineSegment NIL
 

Protected Attributes

Coord point1
 
Coord point2
 

Detailed Description

This class represents a 3 dimensional line segment between two points.

Constructor & Destructor Documentation

inet::LineSegment::LineSegment ( )
24  :
27 {
28 }
static const Coord NIL
Constant with all values set to 0.
Definition: Coord.h:40
Coord point1
Definition: LineSegment.h:35
Coord point2
Definition: LineSegment.h:36
inet::LineSegment::LineSegment ( const Coord point1,
const Coord point2 
)
30  :
31  point1(point1),
32  point2(point2)
33 {
34 }
Coord point1
Definition: LineSegment.h:35
Coord point2
Definition: LineSegment.h:36

Member Function Documentation

bool inet::LineSegment::computeIntersection ( const LineSegment lineSegment,
Coord intersection1,
Coord intersection2 
)
37 {
38  // TODO:
39  throw cRuntimeError("Not yet implemented");
40 }
virtual bool inet::LineSegment::isNil ( ) const
inlineoverridevirtual

Returns true if this geometric object is the same as the unspecified singleton instance of this type.

Implements inet::GeometricObjectBase.

48 { return this == &NIL; }
static const LineSegment NIL
Definition: LineSegment.h:32
virtual bool inet::LineSegment::isUnspecified ( ) const
inlineoverridevirtual

Returns true if this geometric object is not completely specified.

Implements inet::GeometricObjectBase.

49 { return point1.isUnspecified() || point2.isUnspecified(); }
bool isUnspecified() const
Returns true if this coordinate is unspecified.
Definition: Coord.h:257
Coord point1
Definition: LineSegment.h:35
Coord point2
Definition: LineSegment.h:36
double inet::LineSegment::length ( ) const
inline
46 { return point2.distance(point1); }
Coord point1
Definition: LineSegment.h:35
double distance(const Coord &a) const
Returns the distance to Coord &#39;a&#39;.
Definition: Coord.h:201
Coord point2
Definition: LineSegment.h:36
void inet::LineSegment::setPoint1 ( const Coord point1)
inline
43 { this->point1 = point1; }
Coord point1
Definition: LineSegment.h:35
void inet::LineSegment::setPoint2 ( const Coord point2)
inline
45 { this->point2 = point2; }
Coord point2
Definition: LineSegment.h:36

Member Data Documentation

const LineSegment inet::LineSegment::NIL
static
Coord inet::LineSegment::point1
protected
Coord inet::LineSegment::point2
protected

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