CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
OdGsDCRect Class Reference

#include <GsDefs.h>

Public Types

enum  NullFlag { Null }
 

Public Member Functions

 OdGsDCRect ()
 
 OdGsDCRect (const OdGsDCPoint &minPoint, const OdGsDCPoint &maxPoint)
 
 OdGsDCRect (long xMin, long xMax, long yMin, long yMax)
 
 OdGsDCRect (NullFlag)
 
OdGsDCRectoperator= (const OdGsDCRect &dcRect)
 
void operator|= (const OdGsDCRect &dcRect)
 
void operator&= (const OdGsDCRect &dcRect)
 
bool operator== (const OdGsDCRect &dcRect) const
 
bool operator!= (const OdGsDCRect &dcRect) const
 
void set_null ()
 
bool is_null () const
 
bool within (const OdGsDCRect &dcRect) const
 
void offset (long x, long y)
 
void intersectWith (const OdGsDCRect &dcRect, bool bValidate=true)
 
void normalize ()
 
bool isDisjoint (const OdGsDCRect &r) const
 

Public Attributes

OdGsDCPoint m_min
 
OdGsDCPoint m_max
 

Detailed Description

This class represents 2D device coordinate rectangles. Corresponding C++ library: TD_Gs

Remarks
Device coordinates are measured in pixels from the lower-left corner of the device.
See also
Coordinate Systems.

<group OdGs_Classes>

Definition at line 162 of file GsDefs.h.

Member Enumeration Documentation

◆ NullFlag

Enumerator
Null 

Definition at line 165 of file GsDefs.h.

Constructor & Destructor Documentation

◆ OdGsDCRect() [1/4]

OdGsDCRect::OdGsDCRect ( )
inline

Default constructor for the OdGsDCRect class.

Definition at line 169 of file GsDefs.h.

◆ OdGsDCRect() [2/4]

OdGsDCRect::OdGsDCRect ( const OdGsDCPoint minPoint,
const OdGsDCPoint maxPoint 
)
inline

Constructor for the OdGsDCRect class.

Parameters
minPoint[in] Lower-left corner.
maxPoint[in] Upper-right corner.

Definition at line 177 of file GsDefs.h.

◆ OdGsDCRect() [3/4]

OdGsDCRect::OdGsDCRect ( long  xMin,
long  xMax,
long  yMin,
long  yMax 
)
inline

Constructor for the OdGsDCRect class.

Parameters
xMin[in] Minimum X-coordinate.
xMax[in] Maximum X-coordinate.
yMin[in] Minimum Y-coordinate.
yMax[in] Maximum Y-coordinate.

Definition at line 187 of file GsDefs.h.

◆ OdGsDCRect() [4/4]

OdGsDCRect::OdGsDCRect ( NullFlag  )
inline

Constructor for the OdGsDCRect class. Creates a null rectangle.

Definition at line 192 of file GsDefs.h.

Member Function Documentation

◆ intersectWith()

void OdGsDCRect::intersectWith ( const OdGsDCRect dcRect,
bool  bValidate = true 
)
inline

Makes a new rectangle as a result of intersection between this rectangle and the passed rectangle.

Parameters
dcRect[in] Rectangle to intersect with.
bValidate[in] Validates the new rectangle. If set to true, the new rectangle is guarantied to be valid or null.

Definition at line 319 of file GsDefs.h.

◆ is_null()

bool OdGsDCRect::is_null ( ) const
inline

Checks whether this rectangle object is the null rectangle.

Returns
true if this rectangle object is the null rectangle, false otherwise.

Definition at line 276 of file GsDefs.h.

◆ isDisjoint()

bool OdGsDCRect::isDisjoint ( const OdGsDCRect r) const
inline

Checks whether the specified rectangle object does not intersect this rectangle.

Parameters
r[in] Rectangle to check.
Returns
true if the specified rectangle object does not intersect this rectangle, false otherwise.

Definition at line 355 of file GsDefs.h.

◆ normalize()

void OdGsDCRect::normalize ( )
inline

Normalizes this rectangle by setting valid values to minimum and maximum points.

Definition at line 338 of file GsDefs.h.

◆ offset()

void OdGsDCRect::offset ( long  x,
long  y 
)
inline

Moves this rectangle in the provided direction.

Parameters
x[in] Number of pixels to move by x-axis. Negative value moves rectangle in the opposite direction of the positive x-axis.
y[in] Number of pixels to move by y-axis. Negative value moves rectangle in the opposite direction of the positive y-axis.

Definition at line 306 of file GsDefs.h.

◆ operator!=()

bool OdGsDCRect::operator!= ( const OdGsDCRect dcRect) const
inline
Remarks
Inequality operator for the OdGsDCRect class. Rectangles are considered not equal if at least one of the following conditions fails: the minimum point of this rectangle equals to the minimum point of the passed rectangle the maximum point of this rectangle equals to the maximum point of the passed rectangle
Parameters
dcRect[in] 2D rectangle to compare.

Definition at line 258 of file GsDefs.h.

◆ operator&=()

void OdGsDCRect::operator&= ( const OdGsDCRect dcRect)
inline

Assignment by bitwise AND operator for the OdGsDCRect class. The greater values for coordinates are assigned to the minimum point while the minor values are assigned to the maximum point. New rectangle is result of intersection between this rectangle and the passed rectangle.

Parameters
dcRect[in] Rectangle, points of which are assigned, if necessary.

Definition at line 232 of file GsDefs.h.

◆ operator=()

OdGsDCRect & OdGsDCRect::operator= ( const OdGsDCRect dcRect)
inline

Assignment operator for the OdGsDCRect class. Assigns the passed rectangle.

Parameters
dcRect[in] Minimum X-coordinate.

Definition at line 199 of file GsDefs.h.

◆ operator==()

bool OdGsDCRect::operator== ( const OdGsDCRect dcRect) const
inline
Remarks
Equality operator for the OdGsDCRect class. Rectangles are considered equal if: the minimum point of this rectangle equals to the minimum point of the passed rectangle the maximum point of this rectangle equals to the maximum point of the passed rectangle
Parameters
dcPoint[in] 2D rectangle to compare.

Definition at line 245 of file GsDefs.h.

◆ operator|=()

void OdGsDCRect::operator|= ( const OdGsDCRect dcRect)
inline

Assignment by bitwise OR operator for the OdGsDCRect class. The minor values for coordinates are assigned to the minimum point while the greater values are assigned to the maximum point. As result, rectangle is extended.

Parameters
dcRect[in] Rectangle, points of which are assigned, if necessary.

Definition at line 212 of file GsDefs.h.

◆ set_null()

void OdGsDCRect::set_null ( )
inline

Sets this rectangle object to the null rectangle.

Definition at line 265 of file GsDefs.h.

◆ within()

bool OdGsDCRect::within ( const OdGsDCRect dcRect) const
inline

Checks whether this rectangle object is inside the specified rectangle object.

Parameters
dcRect[in] Any display coordinate rectangle.
Returns
true if this rectangle object is inside the specified rectangle object.
Remarks
A coincident edge is considered inside.

Definition at line 292 of file GsDefs.h.

Member Data Documentation

◆ m_max

OdGsDCPoint OdGsDCRect::m_max

Maximum point.

Definition at line 364 of file GsDefs.h.

◆ m_min

OdGsDCPoint OdGsDCRect::m_min

Minimum point.

Definition at line 362 of file GsDefs.h.


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