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

◆ LineSegment() [1/2]

inet::LineSegment::LineSegment ( )
14  :
17 {
18 }

◆ LineSegment() [2/2]

inet::LineSegment::LineSegment ( const Coord point1,
const Coord point2 
)
20  :
21  point1(point1),
22  point2(point2)
23 {
24 }

Member Function Documentation

◆ computeIntersection()

bool inet::LineSegment::computeIntersection ( const LineSegment lineSegment,
Coord intersection1,
Coord intersection2 
)
27 {
28  // TODO
29  throw cRuntimeError("Not yet implemented");
30 }

◆ getPoint1()

◆ getPoint2()

◆ isNil()

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.

38 { return this == &NIL; }

◆ isUnspecified()

virtual bool inet::LineSegment::isUnspecified ( ) const
inlineoverridevirtual

Returns true if this geometric object is not completely specified.

Implements inet::GeometricObjectBase.

39 { return point1.isUnspecified() || point2.isUnspecified(); }

◆ length()

double inet::LineSegment::length ( ) const
inline
36 { return point2.distance(point1); }

Referenced by inet::Cuboid::computeIntersection().

◆ setPoint1()

void inet::LineSegment::setPoint1 ( const Coord point1)
inline
33 { this->point1 = point1; }

◆ setPoint2()

void inet::LineSegment::setPoint2 ( const Coord point2)
inline
35 { this->point2 = point2; }

Member Data Documentation

◆ NIL

const LineSegment inet::LineSegment::NIL
static

◆ point1

Coord inet::LineSegment::point1
protected

◆ point2

Coord inet::LineSegment::point2
protected

The documentation for this class was generated from the following files:
inet::Coord::isUnspecified
bool isUnspecified() const
Returns true if this coordinate is unspecified.
Definition: Coord.h:303
inet::Coord::distance
double distance(const Coord &a) const
Returns the distance to Coord 'a'.
Definition: Coord.h:251
inet::LineSegment::point2
Coord point2
Definition: LineSegment.h:26
inet::Coord::NIL
static const Coord NIL
Constant with all values set to 0.
Definition: Coord.h:26
inet::LineSegment::point1
Coord point1
Definition: LineSegment.h:25
inet::LineSegment::NIL
static const LineSegment NIL
Definition: LineSegment.h:22