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

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • kig
kig_document.h
Go to the documentation of this file.
1 // Copyright (C) 2004 Dominique Devriese <devriese@kde.org>
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_KIG_KIG_DOCUMENT_H
19 #define KIG_KIG_KIG_DOCUMENT_H
20 
21 #include <set>
22 #include <vector>
23 
24 class Coordinate;
25 class CoordinateSystem;
26 class KigWidget;
27 class ObjectHolder;
28 class ObjectCalcer;
29 class Rect;
30 
36 class KigDocument {
43  std::set<ObjectHolder*> mobjects;
44 
50  CoordinateSystem* mcoordsystem;
54  bool mshowgrid;
58  bool mshowaxes;
62  bool mnightvision;
63 
68  int mcoordinatePrecision;
69 
70 public:
71  mutable double mcachedparam;
72 public:
73  KigDocument();
74  KigDocument( std::set<ObjectHolder*> objects, CoordinateSystem* coordsystem,
75  bool showgrid = true, bool showaxes = true, bool nv = false );
76  ~KigDocument();
77 
78  const CoordinateSystem& coordinateSystem() const;
79  bool grid() const;
80  bool axes() const;
81  bool getNightVision() const;
82  bool isUserSpecifiedCoordinatePrecision() const;
83  int getCoordinatePrecision() const;
87  const std::vector<ObjectHolder*> objects() const;
88  const std::set<ObjectHolder*>& objectsSet() const;
89 
93  CoordinateSystem* switchCoordinateSystem( CoordinateSystem* s );
94 
98  void setCoordinateSystem( CoordinateSystem* s );
99 
103  void setGrid( bool showgrid );
104 
108  void setAxes( bool showaxes );
109 
113  void setNightVision( bool nv );
114 
115  void setCoordinatePrecision( int precision );
116 
120  std::vector<ObjectHolder*> whatAmIOn( const Coordinate& p, const KigWidget& w ) const;
121 
125  std::vector<ObjectHolder*> whatIsInHere( const Rect& p, const KigWidget& );
126 
131  Rect suggestedRect() const;
132 
136  void addObject( ObjectHolder* oObject );
140  void addObjects( const std::vector<ObjectHolder*>& os);
144  void delObject( ObjectHolder* o );
148  void delObjects( const std::vector<ObjectHolder*>& os );
155  std::vector<ObjectCalcer*> findIntersectionPoints( const ObjectCalcer* c1,
156  const ObjectCalcer* c2) const;
157 };
158 
159 #endif
CoordinateSystem
a CoordinateSystem is what the user sees: it is kept by KigPart to show the user a grid...
Definition: coordinate_system.h:60
KigDocument::whatIsInHere
std::vector< ObjectHolder * > whatIsInHere(const Rect &p, const KigWidget &)
Return a vector of objects that are in the given Rect.
Definition: kig_document.cc:91
KigDocument::~KigDocument
~KigDocument()
Definition: kig_document.cc:172
KigDocument::delObject
void delObject(ObjectHolder *o)
Remove the object o from the document.
Definition: kig_document.cc:151
KigDocument::grid
bool grid() const
Definition: kig_document.cc:186
KigDocument::objectsSet
const std::set< ObjectHolder * > & objectsSet() const
Definition: kig_document.cc:51
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
KigDocument::getNightVision
bool getNightVision() const
Definition: kig_document.cc:211
KigDocument::addObjects
void addObjects(const std::vector< ObjectHolder * > &os)
Add the objects os to the document.
Definition: kig_document.cc:143
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
KigDocument::getCoordinatePrecision
int getCoordinatePrecision() const
Definition: kig_document.cc:221
KigDocument::setCoordinateSystem
void setCoordinateSystem(CoordinateSystem *s)
sets the coordinate system to s , and deletes the old one.
Definition: kig_document.cc:56
KigDocument::setGrid
void setGrid(bool showgrid)
set to show/hide the grid.
Definition: kig_document.cc:181
ObjectHolder
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
ObjectCalcer
An ObjectCalcer is an object that represents an algorithm for calculating an ObjectImp from other Obj...
Definition: object_calcer.h:66
KigDocument::whatAmIOn
std::vector< ObjectHolder * > whatAmIOn(const Coordinate &p, const KigWidget &w) const
Return a vector of objects that contain the given point.
Definition: kig_document.cc:68
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
KigDocument::objects
const std::vector< ObjectHolder * > objects() const
Get a hold of the objects of this KigDocument.
Definition: kig_document.cc:46
KigDocument::KigDocument
KigDocument()
Definition: kig_document.cc:163
KigDocument::setAxes
void setAxes(bool showaxes)
set to show/hide the grid.
Definition: kig_document.cc:191
KigDocument::setCoordinatePrecision
void setCoordinatePrecision(int precision)
Definition: kig_document.cc:201
KigDocument::findIntersectionPoints
std::vector< ObjectCalcer * > findIntersectionPoints(const ObjectCalcer *c1, const ObjectCalcer *c2) const
Return all the points that belong (by construction) on both the given curves.
Definition: kig_document.cc:248
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
KigDocument::switchCoordinateSystem
CoordinateSystem * switchCoordinateSystem(CoordinateSystem *s)
sets the coordinate system to s , and returns the old one.
Definition: kig_document.cc:61
KigDocument::mcachedparam
double mcachedparam
Definition: kig_document.h:71
KigDocument::addObject
void addObject(ObjectHolder *oObject)
Add the objects o to the document.
Definition: kig_document.cc:138
KigDocument::setNightVision
void setNightVision(bool nv)
set to enable/disable night-vision (visibility of hidden objects)
Definition: kig_document.cc:196
KigDocument::axes
bool axes() const
Definition: kig_document.cc:206
KigDocument::delObjects
void delObjects(const std::vector< ObjectHolder * > &os)
Remove the objects os from the document.
Definition: kig_document.cc:156
KigDocument::coordinateSystem
const CoordinateSystem & coordinateSystem() const
Definition: kig_document.cc:40
KigDocument::isUserSpecifiedCoordinatePrecision
bool isUserSpecifiedCoordinatePrecision() const
Definition: kig_document.cc:216
KigDocument::suggestedRect
Rect suggestedRect() const
Return a rect containing most of the objects, which would be a fine suggestion to map to the widget...
Definition: kig_document.cc:106
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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