Kig Python Scripting API Documentation

Public Member Functions | Static Public Member Functions | List of all members
Object Class Referenceabstract

The Object class represents the behaviour of an object after it is calculated. More...

#include <object_imp.h>

Inheritance diagram for Object:
Inheritance graph
[legend]

Public Member Functions

bool inherits (const ObjectType *t) const
 Returns true if this Object inherits the Object type represented by t. More...
 
virtual Coordinate attachPoint () const =0
 Returns a reference point where to attach labels; when this returns an invalidCoord then the attachment is either not done at all, or done in a specific way (like for curves, or for points) The treatment of points could also take advantage of this attachment mechanism. More...
 
virtual Objecttransform (const Transformation &t) const =0
 Return this Object, transformed by the transformation t.
 
bool valid () const
 Returns true if this is a valid Object. More...
 
virtual const ObjectTypetype () const =0
 Returns the lowermost ObjectType that this object is an instantiation of. More...
 
virtual Objectcopy () const =0
 Returns a copy of this Object. More...
 
virtual bool equals (const Object &rhs) const =0
 Returns true if this Object is equal to rhs. More...
 

Static Public Member Functions

static const ObjectTypestype ()
 The ObjectType representing the base Object class. More...
 

Detailed Description

The Object class represents the behaviour of an object after it is calculated.

This means how to draw() it, whether it claims to contain a certain point etc. It is also the class where the ObjectType's get their information from..

Member Function Documentation

◆ attachPoint()

virtual Coordinate Object::attachPoint ( ) const
pure virtual

Returns a reference point where to attach labels; when this returns an invalidCoord then the attachment is either not done at all, or done in a specific way (like for curves, or for points) The treatment of points could also take advantage of this attachment mechanism.

If this method returns a valid Coordinate, then this is interpreted as a pivot point for the label, which can still be moved relative to that point, but follows the object when the object changes. In practice a new RelativePointType is created (position of the string), this type in turn depends on the object (to get its attachPoint) and two DoubleObject that are interpreted as relative displacement (x and y)

Implemented in BogusObject, Curve, Angle, and Point.

◆ copy()

virtual Object * Object::copy ( ) const
pure virtual

Returns a copy of this Object.

The copy is an exact copy. Changes to the copy don't affect the original.

Implemented in InvalidObject, DoubleObject, IntObject, StringObject, Circle, ConicCart, ConicPolar, Cubic, Segment, Ray, Line, Angle, Vector, Arc, Point, and Curve.

◆ equals()

virtual bool Object::equals ( const Object rhs) const
pure virtual

Returns true if this Object is equal to rhs.

This function checks whether rhs is of the same Object type, and whether it contains the same data as this Object.

Implemented in InvalidObject, DoubleObject, IntObject, StringObject, Circle, Conic, Cubic, AbstractLine, Angle, Vector, Arc, and Point.

◆ inherits()

bool Object::inherits ( const ObjectType t) const

Returns true if this Object inherits the Object type represented by t.

E.g. you can check whether an Object is a Line by doing:

if object.inherits( Line.stype() ):
An Object representing a line.
Definition: line_imp.h:179
static const ObjectType * stype()
Returns the ObjectType representing the Line type.

◆ stype()

static const ObjectType * Object::stype ( )
static

The ObjectType representing the base Object class.

All other Object's inherit from this type.

◆ type()

virtual const ObjectType * Object::type ( ) const
pure virtual

Returns the lowermost ObjectType that this object is an instantiation of.

E.g. if you want to get a string containing the internal name of the type of an object, you can do:

tn = object.type().internalName()

Implemented in InvalidObject, DoubleObject, IntObject, StringObject, Circle, Conic, Cubic, Segment, Ray, Line, Angle, Vector, Arc, and Point.

◆ valid()

bool Object::valid ( ) const

Returns true if this is a valid Object.

If you want to return an invalid Object, you should return an InvalidObject instance.

KDE Logo
This file is part of the documentation for tdelibs .
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed May 15 2024 03:39:42 by doxygen 1.9.4 written by Dimitri van Heesch, © 1997-2001