• 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
  • filters
pgfexporterimpvisitor.h
Go to the documentation of this file.
1 // Copyright (C) 2004 Pino Toscano <toscano.pino@tiscali.it>
2 // Copyright (C) 2012 Raoul Bourquin
3 
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 // 02110-1301, USA.
18 
19 #ifndef KIG_FILTERS_PGFEXPORTERIMPVISITOR_H
20 #define KIG_FILTERS_PGFEXPORTERIMPVISITOR_H
21 
22 #include "../kig/kig_document.h"
23 #include "../kig/kig_part.h"
24 #include "../kig/kig_view.h"
25 
26 #include "../objects/circle_imp.h"
27 #include "../objects/cubic_imp.h"
28 #include "../objects/bezier_imp.h"
29 #include "../objects/curve_imp.h"
30 #include "../objects/line_imp.h"
31 #include "../objects/locus_imp.h"
32 #include "../objects/object_drawer.h"
33 #include "../objects/object_holder.h"
34 #include "../objects/object_imp.h"
35 #include "../objects/other_imp.h"
36 #include "../objects/point_imp.h"
37 #include "../objects/polygon_imp.h"
38 #include "../objects/text_imp.h"
39 
40 
41 class PGFExporterImpVisitor
42  : public ObjectImpVisitor
43 {
44  QTextStream& mstream;
45  ObjectHolder* mcurobj;
46  const KigWidget& mw;
47  Rect msr;
48 
49 public:
50  void visit( ObjectHolder* obj );
51 
52  PGFExporterImpVisitor( QTextStream& s, const KigWidget& w )
53  : mstream( s ), mw( w ), msr( mw.showingRect() )
54  {
55  }
56  using ObjectImpVisitor::visit;
57  void visit( const LineImp* imp );
58  void visit( const PointImp* imp );
59  void visit( const TextImp* imp );
60  void visit( const AngleImp* imp );
61  void visit( const VectorImp* imp );
62  void visit( const LocusImp* imp );
63  void visit( const CircleImp* imp );
64  void visit( const ConicImp* imp );
65  void visit( const CubicImp* imp );
66  void visit( const SegmentImp* imp );
67  void visit( const RayImp* imp );
68  void visit( const ArcImp* imp );
69  void visit( const FilledPolygonImp* imp );
70  void visit( const ClosedPolygonalImp* imp );
71  void visit( const OpenPolygonalImp* imp );
72  void visit( const BezierImp* imp);
73  void visit( const RationalBezierImp* imp);
74 
75  double unit;
76 
77 private:
82  static const uint maxlinelength = 500;
83 
87  QString emitPenColor( const QColor& c );
88 
92  QString emitPenStyle( const Qt::PenStyle& style );
93 
97  QString emitPenSize( const int width );
98 
102  QString emitPen( const QColor& c, const int width, const Qt::PenStyle& style );
103 
107  QString emitStyle( const ObjectDrawer* od );
108 
112  QString emitCoord( const Coordinate& c );
113 
117  void emitLine( const Coordinate& a, const Coordinate& b, const ObjectDrawer* od, bool vector = false );
118 
122  void newLine();
123 
128  double dimRealToCoord( int dim );
129 
133  void plotGenericCurve( const CurveImp* imp );
134 };
135 
136 #endif
ClosedPolygonalImp
An ObjectImp representing a closed polygonal.
Definition: polygon_imp.h:130
BezierImp
An ObjectImp representing polynomial Bézier Curve.
Definition: bezier_imp.h:31
CubicImp
An ObjectImp representing a cubic.
Definition: cubic_imp.h:29
LocusImp
LocusImp is an imp that consists of a copy of the curveimp that the moving point moves over...
Definition: locus_imp.h:57
OpenPolygonalImp
An ObjectImp representing an open polygonal.
Definition: polygon_imp.h:157
ObjectImpVisitor::visit
void visit(const ObjectImp *imp)
Definition: object_imp.cc:81
CircleImp
An ObjectImp representing a circle.
Definition: circle_imp.h:27
TextImp
Definition: text_imp.h:26
PGFExporterImpVisitor
Definition: pgfexporterimpvisitor.h:41
RayImp
An ObjectImp representing a ray.
Definition: line_imp.h:136
Rect
This file is part of Kig, a KDE program for Interactive Geometry...
Definition: rect.h:34
RationalBezierImp
An ObjectImp representing a rational Bézier curve.
Definition: bezier_imp.h:100
Coordinate
The Coordinate class is the basic class representing a 2D location by its x and y components...
Definition: coordinate.h:33
VectorImp
An ObjectImp representing a vector.
Definition: other_imp.h:99
PGFExporterImpVisitor::PGFExporterImpVisitor
PGFExporterImpVisitor(QTextStream &s, const KigWidget &w)
Definition: pgfexporterimpvisitor.h:52
ObjectHolder
An ObjectHolder represents an object as it is known to the document.
Definition: object_holder.h:40
PointImp
An ObjectImp representing a point.
Definition: point_imp.h:27
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
ConicImp
An ObjectImp representing a conic.
Definition: conic_imp.h:39
ObjectDrawer
A class holding some information about how a certain object is drawn on the window.
Definition: object_drawer.h:47
PGFExporterImpVisitor::visit
void visit(ObjectHolder *obj)
Definition: pgfexporterimpvisitor.cc:215
LineImp
An ObjectImp representing a line.
Definition: line_imp.h:184
ArcImp
An ObjectImp representing an arc.
Definition: other_imp.h:169
FilledPolygonImp
An ObjectImp representing a filled polygon.
Definition: polygon_imp.h:101
PGFExporterImpVisitor::unit
double unit
Definition: pgfexporterimpvisitor.h:75
uint
unsigned int uint
Definition: object_imp.h:87
ObjectImpVisitor
Definition: object_imp.h:56
AngleImp
An ObjectImp representing an angle.
Definition: other_imp.h:28
CurveImp
This class represents a curve: something which is composed of points, like a line, a circle, a locus.
Definition: curve_imp.h:27
SegmentImp
An ObjectImp representing a segment.
Definition: line_imp.h:81
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