• 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
bezier_type.h
Go to the documentation of this file.
1 // Copyright (C) 2009 Petr Gajdos <pgajdos@suse.cz>
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_BEZIER_TYPE_H
19 #define KIG_OBJECTS_BEZIER_TYPE_H
20 
21 #include "base_type.h"
22 
26 class BezierQuadricType
27  : public ArgsParserObjectType
28 {
29  BezierQuadricType();
30  ~BezierQuadricType();
31 public:
32  static const BezierQuadricType* instance();
33 
34  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
35  const ObjectImpType* resultId() const;
36  bool canMove( const ObjectTypeCalcer& o ) const;
37  bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
38  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
39  void move( ObjectTypeCalcer& o, const Coordinate& to,
40  const KigDocument& d ) const;
41  const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
42 };
43 
47 class BezierCubicType
48  : public ArgsParserObjectType
49 {
50  BezierCubicType();
51  ~BezierCubicType();
52 public:
53  static const BezierCubicType* instance();
54 
55  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
56  const ObjectImpType* resultId() const;
57  bool canMove( const ObjectTypeCalcer& o ) const;
58  bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
59  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
60  void move( ObjectTypeCalcer& o, const Coordinate& to,
61  const KigDocument& d ) const;
62  const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
63 };
64 
68 class BezierCurveType
69  : public ObjectType
70 {
71  BezierCurveType();
72  ~BezierCurveType();
73 public:
74  static const BezierCurveType* instance();
75 
76  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
77  const ObjectImpType* resultId() const;
78  const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
79  bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
80  std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args ) const;
81  Args sortArgs( const Args& args ) const;
82 
83  bool canMove( const ObjectTypeCalcer& o ) const;
84  bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
85  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
86  void move( ObjectTypeCalcer& o, const Coordinate& to,
87  const KigDocument& d ) const;
88  const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
89 };
90 
94 class RationalBezierQuadricType
95  : public ArgsParserObjectType
96 {
97  RationalBezierQuadricType();
98  ~RationalBezierQuadricType();
99 public:
100  static const RationalBezierQuadricType* instance();
101 
102  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
103  const ObjectImpType* resultId() const;
104  bool canMove( const ObjectTypeCalcer& o ) const;
105  bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
106  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
107  void move( ObjectTypeCalcer& o, const Coordinate& to,
108  const KigDocument& d ) const;
109  const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
110 };
111 
115 class RationalBezierCubicType
116  : public ArgsParserObjectType
117 {
118  RationalBezierCubicType();
119  ~RationalBezierCubicType();
120 public:
121  static const RationalBezierCubicType* instance();
122 
123  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
124  const ObjectImpType* resultId() const;
125  bool canMove( const ObjectTypeCalcer& o ) const;
126  bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
127  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
128  void move( ObjectTypeCalcer& o, const Coordinate& to,
129  const KigDocument& d ) const;
130  const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
131 };
132 
136 class RationalBezierCurveType
137  : public ObjectType
138 {
139  RationalBezierCurveType();
140  ~RationalBezierCurveType();
141 public:
142  static const RationalBezierCurveType* instance();
143 
144  ObjectImp* calc( const Args& parents, const KigDocument& ) const;
145  const ObjectImpType* resultId() const;
146  const ObjectImpType* impRequirement( const ObjectImp* o, const Args& parents ) const;
147  bool isDefinedOnOrThrough( const ObjectImp* o, const Args& parents ) const;
148  std::vector<ObjectCalcer*> sortArgs( const std::vector<ObjectCalcer*>& args ) const;
149  Args sortArgs( const Args& args ) const;
150 
151  bool canMove( const ObjectTypeCalcer& o ) const;
152  bool isFreelyTranslatable( const ObjectTypeCalcer& o ) const;
153  std::vector<ObjectCalcer*> movableParents( const ObjectTypeCalcer& ourobj ) const;
154  void move( ObjectTypeCalcer& o, const Coordinate& to,
155  const KigDocument& d ) const;
156  const Coordinate moveReferencePoint( const ObjectTypeCalcer& o ) const;
157 };
158 
159 
160 #endif
BezierCubicType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: bezier_type.cc:200
RationalBezierCubicType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: bezier_type.cc:567
BezierCurveType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:312
ObjectImpType
Instances of this class represent a certain ObjectImp type.
Definition: object_imp.h:95
BezierCurveType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: bezier_type.cc:280
RationalBezierCurveType::instance
static const RationalBezierCurveType * instance()
Definition: bezier_type.cc:600
ArgsParserObjectType
This is a convenience subclass of ObjectType that a type should inherit from if its parents can be sp...
Definition: object_type.h:113
RationalBezierQuadricType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: bezier_type.cc:427
RationalBezierQuadricType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:414
BezierQuadricType::instance
static const BezierQuadricType * instance()
Definition: bezier_type.cc:62
BezierQuadricType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:91
BezierQuadricType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:86
RationalBezierQuadricType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: bezier_type.cc:451
RationalBezierCubicType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: bezier_type.cc:503
RationalBezierCubicType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:527
RationalBezierCurveType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:654
BezierQuadricType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: bezier_type.cc:122
RationalBezierCubicType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:532
ObjectTypeCalcer
This is an ObjectCalcer that uses one of the various ObjectType's to calculate its ObjectImp...
Definition: object_calcer.h:183
RationalBezierQuadricType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: bezier_type.cc:409
RationalBezierCurveType
Rational Bézier curve of degree n.
Definition: bezier_type.h:136
BezierCurveType::isDefinedOnOrThrough
bool isDefinedOnOrThrough(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: bezier_type.cc:290
RationalBezierCurveType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:659
RationalBezierQuadricType
Rational Bézier curve of degree 2.
Definition: bezier_type.h:94
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
BezierCubicType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:191
RationalBezierCurveType::impRequirement
const ObjectImpType * impRequirement(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: bezier_type.cc:632
RationalBezierCurveType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: bezier_type.cc:644
BezierCubicType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:186
BezierQuadricType
Bézier curve of degree 2.
Definition: bezier_type.h:26
RationalBezierCurveType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: bezier_type.cc:606
BezierCubicType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:219
Args
std::vector< const ObjectImp * > Args
Definition: objects/common.h:47
BezierCubicType::instance
static const BezierCubicType * instance()
Definition: bezier_type.cc:162
BezierCurveType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: bezier_type.cc:322
RationalBezierCubicType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: bezier_type.cc:522
BezierCurveType::impRequirement
const ObjectImpType * impRequirement(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: bezier_type.cc:285
BezierCurveType::canMove
bool canMove(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:307
RationalBezierQuadricType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:444
RationalBezierCurveType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: bezier_type.cc:688
BezierCurveType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:334
ObjectType
The ObjectType class is a thing that represents the "behaviour" for a certain type.
Definition: object_type.h:32
RationalBezierCubicType
Rational Bézier curve of degree 3.
Definition: bezier_type.h:115
BezierCubicType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: bezier_type.cc:168
RationalBezierQuadricType::isFreelyTranslatable
bool isFreelyTranslatable(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:419
BezierCurveType
Bézier curve of degree n.
Definition: bezier_type.h:68
BezierCurveType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: bezier_type.cc:264
RationalBezierCurveType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:681
RationalBezierCubicType::instance
static const RationalBezierCubicType * instance()
Definition: bezier_type.cc:497
BezierCurveType::sortArgs
std::vector< ObjectCalcer * > sortArgs(const std::vector< ObjectCalcer * > &args) const
Definition: bezier_type.cc:297
BezierCubicType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: bezier_type.cc:226
BezierQuadricType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: bezier_type.cc:68
BezierQuadricType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:115
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
RationalBezierCurveType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: bezier_type.cc:627
RationalBezierCubicType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: bezier_type.cc:541
RationalBezierQuadricType::calc
ObjectImp * calc(const Args &parents, const KigDocument &) const
Definition: bezier_type.cc:390
BezierQuadricType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: bezier_type.cc:81
ObjectImp
The ObjectImp class represents the behaviour of an object after it is calculated. ...
Definition: object_imp.h:226
BezierQuadricType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: bezier_type.cc:99
BezierCubicType
Bézier curve of degree 3.
Definition: bezier_type.h:47
base_type.h
RationalBezierCubicType::moveReferencePoint
const Coordinate moveReferencePoint(const ObjectTypeCalcer &o) const
Definition: bezier_type.cc:560
RationalBezierQuadricType::instance
static const RationalBezierQuadricType * instance()
Definition: bezier_type.cc:384
RationalBezierCurveType::isDefinedOnOrThrough
bool isDefinedOnOrThrough(const ObjectImp *o, const Args &parents) const
Supposing that parents would be given as parents to this type's calc function, this function returns ...
Definition: bezier_type.cc:637
BezierCubicType::resultId
const ObjectImpType * resultId() const
returns the ObjectImp id of the ObjectImp's produced by this ObjectType.
Definition: bezier_type.cc:181
BezierCurveType::movableParents
std::vector< ObjectCalcer * > movableParents(const ObjectTypeCalcer &ourobj) const
Definition: bezier_type.cc:341
BezierCurveType::instance
static const BezierCurveType * instance()
Definition: bezier_type.cc:258
RationalBezierCurveType::move
void move(ObjectTypeCalcer &o, const Coordinate &to, const KigDocument &d) const
Definition: bezier_type.cc:669
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