• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.14
  • kdeedu
  • kig
  • objects
special_imptypes.h
Go to the documentation of this file.
1 // Copyright (C) 2005 Maurizio Paolini <paolini@dmf.unicatt.it>
2 
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #ifndef KIG_OBJECTS_SPECIAL_IMPTYPES_H
19 #define KIG_OBJECTS_SPECIAL_IMPTYPES_H
20 
21 #include "object_imp.h"
22 
23 /*
24  * (mp)
25  * special_imptype(s) are a way to identify transversal classes
26  * of objects, such as e.g. circles/lines/segments/rays to be
27  * used for circular inversion.
28  *
29  * getDoubleFromImp: is used to get a double from various
30  * different Imp(s): DoubeImp, NumericTextImp, SegmentImp (length)
31  *
32  * class LengthImpType:
33  * is used to match different Imp(s) upon construction
34  *
35  * lengthimptypeinstance: is just an instance of such class
36  *
37  * Similarly for AngleImpType and WeightImpType
38  * angleimptypeinstance: is just an instance of AngleImpType class
39  * weightimptypeinstance: is just an instance of WeightImpType class
40  *
41  */
42 
43 double getDoubleFromImp( const ObjectImp*, bool& );
44 
45 class LengthImpType
46  : public ObjectImpType
47 {
48 public:
49  LengthImpType( const ObjectImpType* parent, const char* internalname );
50  ~LengthImpType();
51  virtual bool match( const ObjectImpType* t ) const;
52 };
53 
54 extern LengthImpType lengthimptypeinstance;
55 
56 class AngleImpType
57  : public ObjectImpType
58 {
59 public:
60  AngleImpType( const ObjectImpType* parent, const char* internalname );
61  ~AngleImpType();
62  virtual bool match( const ObjectImpType* t ) const;
63 };
64 
65 extern AngleImpType angleimptypeinstance;
66 
67 class WeightImpType
68  : public ObjectImpType
69 {
70 public:
71  WeightImpType( const ObjectImpType* parent, const char* internalname );
72  ~WeightImpType();
73  virtual bool match( const ObjectImpType* t ) const;
74 };
75 
76 extern WeightImpType weightimptypeinstance;
77 
78 /*
79  * The "InvertibleImpType" class, inherited fron ObjectImpType
80  * is used to recognize non-point objects that we know how to
81  * circular-invert, namely: lines, segments, rays, circles, arcs.
82  * The trick is done by redefining the "match" method of the
83  * class in order to return "true" if the argument is one of the
84  * types above.
85  * This same trick could also be used for TransportOfMeasure in
86  * order to allow us to inherit from ArgsParserObjectType instead of
87  * directly from ObjectType.
88  */
89 
90 class InvertibleImpType
91  : public ObjectImpType
92 {
93 public:
94  InvertibleImpType( const ObjectImpType* parent, const char* internalname );
95  ~InvertibleImpType();
96  virtual bool match( const ObjectImpType* t ) const;
97 };
98 
99 extern InvertibleImpType invertibleimptypeinstance;
100 
101 #endif
AngleImpType::match
virtual bool match(const ObjectImpType *t) const
Definition: special_imptypes.cc:84
object_imp.h
WeightImpType::WeightImpType
WeightImpType(const ObjectImpType *parent, const char *internalname)
Definition: special_imptypes.cc:92
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
WeightImpType::match
virtual bool match(const ObjectImpType *t) const
Definition: special_imptypes.cc:103
AngleImpType::AngleImpType
AngleImpType(const ObjectImpType *parent, const char *internalname)
Definition: special_imptypes.cc:73
angleimptypeinstance
AngleImpType angleimptypeinstance
LengthImpType::match
virtual bool match(const ObjectImpType *t) const
Definition: special_imptypes.cc:64
InvertibleImpType::~InvertibleImpType
~InvertibleImpType()
Definition: special_imptypes.cc:119
InvertibleImpType::InvertibleImpType
InvertibleImpType(const ObjectImpType *parent, const char *internalname)
Definition: special_imptypes.cc:112
LengthImpType
Definition: special_imptypes.h:45
lengthimptypeinstance
LengthImpType lengthimptypeinstance
InvertibleImpType::match
virtual bool match(const ObjectImpType *t) const
Definition: special_imptypes.cc:123
LengthImpType::~LengthImpType
~LengthImpType()
Definition: special_imptypes.cc:60
invertibleimptypeinstance
InvertibleImpType invertibleimptypeinstance
InvertibleImpType
Definition: special_imptypes.h:90
LengthImpType::LengthImpType
LengthImpType(const ObjectImpType *parent, const char *internalname)
Definition: special_imptypes.cc:53
getDoubleFromImp
double getDoubleFromImp(const ObjectImp *, bool &)
Definition: special_imptypes.cc:27
AngleImpType::~AngleImpType
~AngleImpType()
Definition: special_imptypes.cc:80
weightimptypeinstance
WeightImpType weightimptypeinstance
AngleImpType
Definition: special_imptypes.h:56
WeightImpType::~WeightImpType
~WeightImpType()
Definition: special_imptypes.cc:99
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
WeightImpType
Definition: special_imptypes.h:67
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal