Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

RS_Hatch Class Reference

Class for a hatch entity. More...

#include <rs_hatch.h>

Inheritance diagram for RS_Hatch:

RS_EntityContainer RS_Entity RS_Undoable RS_Flags List of all members.

Public Member Functions

 RS_Hatch (RS_EntityContainer *parent, const RS_HatchData &d)
 Constructor.
virtual RS_Entityclone ()
virtual RS2::EntityType rtti () const
virtual bool isContainer () const
RS_HatchData getData () const
bool validate ()
 Validates the hatch.
int countLoops ()
bool isSolid () const
void setSolid (bool solid)
RS_String getPattern ()
void setPattern (const RS_String &pattern)
double getScale ()
void setScale (double scale)
double getAngle ()
void setAngle (double angle)
virtual void calculateBorders ()
 Recalculates the borders of this hatch.
void update ()
 Updates the Hatch.
void activateContour (bool on)
 Activates of deactivates the hatch boundary.
virtual void draw (RS_Painter *painter, RS_GraphicView *view, double patternOffset=0.0)
 Overrides drawing of subentities.
virtual double getLength ()
virtual double getDistanceToPoint (const RS_Vector &coord, RS_Entity **entity=NULL, RS2::ResolveLevel level=RS2::ResolveNone, double solidDist=RS_MAXDOUBLE)
 Must be overwritten to get the shortest distance between this entity and a coordinate.
virtual void move (const RS_Vector &offset)
 Implementations must move the entity by the given vector.
virtual void rotate (const RS_Vector &center, double angle)
 Implementations must rotate the entity by the given angle around the given center.
virtual void scale (const RS_Vector &center, const RS_Vector &factor)
 Implementations must scale the entity by the given factors.
virtual void mirror (const RS_Vector &axisPoint1, const RS_Vector &axisPoint2)
 Implementations must mirror the entity by the given axis.
virtual void stretch (const RS_Vector &firstCorner, const RS_Vector &secondCorner, const RS_Vector &offset)
 Implementations must stretch the given range of the entity by the given offset.

Protected Attributes

RS_HatchData data
RS_EntityContainerhatch
bool updateRunning
bool needOptimization

Detailed Description

Class for a hatch entity.

Author:
Andrew Mustun


Member Function Documentation

int RS_Hatch::countLoops  ) 
 

Returns:
Number of loops.

RS_HatchData RS_Hatch::getData  )  const [inline]
 

Returns:
Copy of data that defines the hatch.

double RS_Hatch::getDistanceToPoint const RS_Vector coord,
RS_Entity **  entity = NULL,
RS2::ResolveLevel  level = RS2::ResolveNone,
double  solidDist = RS_MAXDOUBLE
[virtual]
 

Must be overwritten to get the shortest distance between this entity and a coordinate.

Parameters:
coord Coordinate (typically a mouse coordinate)
entity Pointer which will contain the (sub-)entity which is closest to the given point or NULL if the caller is not interested in this information.
level The resolve level.
See also:
RS2::ResolveLevel
Returns:
The measured distance between coord and the entity.

Reimplemented from RS_EntityContainer.

virtual double RS_Hatch::getLength  )  [inline, virtual]
 

Returns:
Total length of all entities in this container.

Reimplemented from RS_EntityContainer.

virtual bool RS_Hatch::isContainer  )  const [inline, virtual]
 

Returns:
true: if this is a hatch with lines (hatch pattern), false: if this is filled with a solid color.

Reimplemented from RS_EntityContainer.

bool RS_Hatch::isSolid  )  const [inline]
 

Returns:
true if this is a solid fill. false if it is a pattern hatch.

virtual RS2::EntityType RS_Hatch::rtti  )  const [inline, virtual]
 

Returns:
RS2::EntityHatch

Reimplemented from RS_EntityContainer.

void RS_Hatch::stretch const RS_Vector firstCorner,
const RS_Vector secondCorner,
const RS_Vector offset
[virtual]
 

Implementations must stretch the given range of the entity by the given offset.

This default implementation moves the whole entity if it is completely inside the given range.

Reimplemented from RS_EntityContainer.

void RS_Hatch::update  )  [virtual]
 

Updates the Hatch.

Called when the hatch or it's data, position, alignment, .. changes.

Reimplemented from RS_EntityContainer.


The documentation for this class was generated from the following files:
Generated on Sat Jan 6 13:48:23 2007 for qcadlib by  doxygen 1.4.4