Logo Search packages:      
Sourcecode: qcad version File versions  Download package

RS_Document Class Reference

#include <rs_document.h>

Inheritance diagram for RS_Document:

RS_EntityContainer RS_Undo RS_Entity RS_Undoable RS_Flags RS_Block RS_Graphic RS_FontChar

List of all members.

Detailed Description

Base class for documents. Documents can be either graphics or blocks and are typically shown in graphic views. Documents hold an active pen for drawing in the Document, a file name and they know whether they have been modified or not.

Andrew Mustun

Definition at line 46 of file rs_document.h.

Public Member Functions

virtual void addEntity (RS_Entity *entity)
void addGraphicVariable (const RS_String &key, const RS_String &val, int code)
void addGraphicVariable (const RS_String &key, int val, int code)
void addGraphicVariable (const RS_String &key, double val, int code)
virtual void addUndoable (RS_Undoable *u)
void addUndoCycle (RS_UndoCycle *i)
virtual void adjustBorders (RS_Entity *entity)
virtual void calculateBorders ()
virtual void changeUndoState ()
virtual void clear ()
virtual RS_Entityclone ()
virtual unsigned long int count ()
virtual unsigned long int countDeep ()
virtual int countRedoCycles ()
virtual unsigned long int countSelected ()
virtual int countUndoCycles ()
RS_PtrListIterator< RS_EntitycreateIterator ()
virtual RS_EntitycurrentEntity ()
void delFlag (unsigned int f)
void delUserDefVar (RS_String key)
virtual void detach ()
virtual void draw (RS_Painter *painter, RS_GraphicView *view, double patternOffset=0.0)
virtual void endUndoCycle ()
virtual int entityAt ()
virtual RS_EntityentityAt (uint index)
virtual int findEntity (RS_Entity *entity)
virtual RS_EntityfirstEntity (RS2::ResolveLevel level=RS2::ResolveNone)
virtual void forcedCalculateBorders ()
RS_Pen getActivePen () const
RS_StringList getAllKeys ()
RS_BlockgetBlock ()
virtual RS_BlockListgetBlockList ()=0
RS_EntitygetBlockOrInsert ()
virtual double getDistanceToPoint (const RS_Vector &coord, RS_Entity **entity, RS2::ResolveLevel level=RS2::ResolveNone, double solidDist=RS_MAXDOUBLE)
RS_DocumentgetDocument ()
RS_String getFilename () const
bool getFlag (unsigned int f) const
unsigned int getFlags () const
RS_GraphicgetGraphic ()
RS2::Unit getGraphicUnit ()
double getGraphicVariableDouble (const RS_String &key, double def)
int getGraphicVariableInt (const RS_String &key, int def)
RS_String getGraphicVariableString (const RS_String &key, const RS_String &def)
unsigned long int getId () const
RS_InsertgetInsert ()
RS_LayergetLayer (bool resolve=true) const
virtual RS_LayerListgetLayerList ()=0
virtual double getLength ()
RS_Vector getMax () const
RS_Vector getMin () const
virtual RS_Vector getNearestCenter (const RS_Vector &coord, double *dist=NULL)
virtual RS_Vector getNearestDist (double, bool)
virtual RS_Vector getNearestDist (double distance, const RS_Vector &coord, double *dist=NULL)
virtual RS_Vector getNearestEndpoint (const RS_Vector &coord, double *dist=NULL)
RS_EntitygetNearestEntity (const RS_Vector &point, double *dist=NULL, RS2::ResolveLevel level=RS2::ResolveAll)
virtual RS_Vector getNearestIntersection (const RS_Vector &coord, double *dist=NULL)
virtual RS_Vector getNearestMiddle (const RS_Vector &coord, double *dist=NULL)
virtual RS_Vector getNearestPointOnEntity (const RS_Vector &coord, bool onEntity=true, double *dist=NULL, RS_Entity **entity=NULL)
virtual RS_Vector getNearestRef (const RS_Vector &coord, double *dist=NULL)
virtual RS_Vector getNearestSelectedRef (const RS_Vector &coord, double *dist=NULL)
RS_EntityContainergetParent () const
RS_Pen getPen (bool resolve=true) const
virtual RS_UndoCyclegetRedoCycle ()
virtual RS_VectorSolutions getRefPoints ()
RS_Vector getSize () const
double getStyleFactor (RS_GraphicView *view)
virtual RS_UndoCyclegetUndoCycle ()
RS_String * getUserDefVar (RS_String key)
virtual bool hasEndpointsWithinWindow (RS_Vector v1, RS_Vector v2)
void init ()
virtual void initId ()
virtual void insertEntity (int index, RS_Entity *entity)
virtual bool isAtomic () const
virtual bool isContainer () const
virtual bool isDocument () const
virtual bool isEdge () const
virtual bool isEmpty ()
virtual bool isHighlighted ()
virtual bool isInWindow (RS_Vector v1, RS_Vector v2)
virtual bool isLocked ()
virtual bool isModified () const
virtual bool isParentSelected ()
virtual bool isPointOnEntity (const RS_Vector &coord, double tolerance=RS_TOLERANCE)
virtual bool isProcessed () const
virtual bool isSelected () const
virtual bool isUndone () const
virtual bool isVisible ()
virtual RS_EntitylastEntity (RS2::ResolveLevel level=RS2::ResolveNone)
virtual void mirror (RS_Vector axisPoint1, RS_Vector axisPoint2)
virtual void move (RS_Vector offset)
virtual void moveRef (const RS_Vector &ref, const RS_Vector &offset)
virtual void moveSelectedRef (const RS_Vector &ref, const RS_Vector &offset)
virtual void newDoc ()=0
virtual RS_EntitynextEntity (RS2::ResolveLevel level=RS2::ResolveNone)
virtual bool open (const RS_String &filename, RS2::FormatType type)=0
virtual bool optimizeContours ()
virtual RS_EntityprevEntity (RS2::ResolveLevel level=RS2::ResolveNone)
virtual void redo ()
virtual bool removeEntity (RS_Entity *entity)
virtual void removeUndoable (RS_Undoable *u)
virtual void renameInserts (const RS_String &oldName, const RS_String &newName)
void reparent (RS_EntityContainer *parent)
virtual void replaceEntity (int index, RS_Entity *entity)
void resetBorders ()
void resetFlags ()
virtual void rotate (RS_Vector center, double angle)
 RS_Document (RS_EntityContainer *parent=NULL)
virtual RS2::EntityType rtti () const
virtual bool save ()=0
virtual bool saveAs (const RS_String &filename, RS2::FormatType type)=0
virtual void scale (RS_Vector center, double factor)
virtual void scale (RS_Vector center, RS_Vector factor)
virtual void selectWindow (RS_Vector v1, RS_Vector v2, bool select=true, bool cross=false)
void setActivePen (RS_Pen p)
virtual void setAutoUpdateBorders (bool enable)
void setFilename (const RS_String &fn)
void setFlag (unsigned int f)
void setFlags (unsigned int f)
virtual void setHighlighted (bool on)
void setLayer (RS_Layer *l)
void setLayer (const RS_String &name)
void setLayerToActive ()
virtual void setModified (bool m)
void setParent (RS_EntityContainer *p)
void setPen (const RS_Pen &pen)
void setPenToActive ()
virtual void setProcessed (bool on)
virtual bool setSelected (bool select=true)
virtual void setUndoCycle (RS_UndoCycle *cycle)
virtual void setUndoState (bool undone)
virtual void setUpdateEnabled (bool on)
void setUserDefVar (RS_String key, RS_String val)
virtual void setVisible (bool v)
virtual void startUndoCycle ()
virtual void stretch (RS_Vector firstCorner, RS_Vector secondCorner, RS_Vector offset)
void toggleFlag (unsigned int f)
virtual bool toggleSelected ()
virtual void undo ()
virtual RS2::UndoableType undoRtti ()
virtual void undoStateChanged (bool undone)
virtual void update ()
virtual void updateDimensions ()
virtual void updateInserts ()
virtual void updateSplines ()

Static Public Member Functions

static bool test ()

Protected Attributes

RS_Pen activePen
RS_PtrList< RS_Entityentities
RS_String filename
RS2::FormatType formatType
unsigned long int id
 Entity id.
 Pointer to layer.
RS_Vector maxV
 maximum coordinates
RS_Vector minV
 minimum coordinates
bool modified
 Entity's parent entity or NULL is this entity has no parent.
RS_Pen pen
 pen (attributes) for this entity
RS_PtrList< RS_UndoCycleundoList
 List of undo list items. every item is something that can be undone.
int undoPointer
bool updateEnabled
 auto updating enabled?

Static Protected Attributes

static bool autoUpdateBorders = true


std::ostream & operator<< (std::ostream &os, RS_Undo &a)
std::ostream & operator<< (std::ostream &os, RS_Entity &e)
std::ostream & operator<< (std::ostream &os, RS_EntityContainer &ec)

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

Generated by  Doxygen 1.6.0   Back to index