• 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
xfigexporter.cc
Go to the documentation of this file.
1 // Copyright (C) 2003 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 #include "xfigexporter.h"
19 
20 #include <math.h>
21 
22 #include "../kig/kig_document.h"
23 #include "../kig/kig_part.h"
24 #include "../kig/kig_view.h"
25 #include "../misc/common.h"
26 #include "../misc/kigfiledialog.h"
27 #include "../misc/kigpainter.h"
28 #include "../objects/circle_imp.h"
29 #include "../objects/line_imp.h"
30 #include "../objects/object_drawer.h"
31 #include "../objects/object_holder.h"
32 #include "../objects/object_imp.h"
33 #include "../objects/other_imp.h"
34 #include "../objects/point_imp.h"
35 #include "../objects/polygon_imp.h"
36 #include "../objects/text_imp.h"
37 
38 #include <qcolor.h>
39 #include <qfile.h>
40 #include <qtextstream.h>
41 
42 #include <klocale.h>
43 #include <kmessagebox.h>
44 
45 #include <map>
46 #include <iterator>
47 
48 // we need this for storing colors in a std::map..
49 static bool operator<( const QColor& a, const QColor& b )
50 {
51  return a.rgb() < b.rgb();
52 }
53 
54 XFigExporter::~XFigExporter()
55 {
56 }
57 
58 QString XFigExporter::exportToStatement() const
59 {
60  return i18n( "Export to &XFig file" );
61 }
62 
63 
64 QString XFigExporter::menuEntryName() const
65 {
66  return i18n( "&XFig File..." );
67 }
68 
69 QString XFigExporter::menuIcon() const
70 {
71  return "kig_xfig";
72 }
73 
74 class XFigExportImpVisitor
75  : public ObjectImpVisitor
76 {
77  QTextStream& mstream;
78  ObjectHolder* mcurobj;
79  const KigWidget& mw;
80  Rect msr;
81  std::map<QColor, int> mcolormap;
82  int mnextcolorid;
83  int mcurcolorid;
84 
85  QPoint convertCoord( const Coordinate& c )
86  {
87  Coordinate ret = ( c - msr.bottomLeft() );
88  ret.y = msr.height() - ret.y;
89 // kDebug() << "msr: " << msr
90 // << "ret: " << ret << endl
91 // << "c: " << c << endl;
92  ret *= 9450;
93  ret /= msr.width();
94  return ret.toQPoint();
95  }
96 
97  void emitLine( const Coordinate& a, const Coordinate& b, int width, bool vector = false );
98 public:
99  void visit( ObjectHolder* obj );
100  void mapColor( const ObjectDrawer* obj );
101 
102  XFigExportImpVisitor( QTextStream& s, const KigWidget& w )
103  : mstream( s ), mw( w ), msr( mw.showingRect() ),
104  mnextcolorid( 32 )
105  {
106  // predefined colors in XFig..
107  mcolormap[Qt::black] = 0;
108  mcolormap[Qt::blue] = 1;
109  mcolormap[Qt::green] = 2;
110  mcolormap[Qt::cyan] = 3;
111  mcolormap[Qt::red] = 4;
112  mcolormap[Qt::magenta] = 5;
113  mcolormap[Qt::yellow] = 6;
114  mcolormap[Qt::white] = 7;
115  }
116  using ObjectImpVisitor::visit;
117  void visit( const LineImp* imp );
118  void visit( const PointImp* imp );
119  void visit( const TextImp* imp );
120  void visit( const AngleImp* imp );
121  void visit( const VectorImp* imp );
122  void visit( const LocusImp* imp );
123  void visit( const CircleImp* imp );
124  void visit( const ConicImp* imp );
125  void visit( const CubicImp* imp );
126  void visit( const SegmentImp* imp );
127  void visit( const RayImp* imp );
128  void visit( const ArcImp* imp );
129  void visit( const FilledPolygonImp* imp );
130  void visit( const ClosedPolygonalImp* imp );
131  void visit( const OpenPolygonalImp* imp );
132 };
133 
134 void XFigExportImpVisitor::mapColor( const ObjectDrawer* obj )
135 {
136  if ( ! obj->shown() ) return;
137  QColor color = obj->color();
138  if ( mcolormap.find( color ) == mcolormap.end() )
139  {
140  int newcolorid = mnextcolorid++;
141  mstream << "0 "
142  << newcolorid << " "
143  << color.name() << "\n";
144  mcolormap[color] = newcolorid;
145  }
146 }
147 
148 void XFigExportImpVisitor::visit( ObjectHolder* obj )
149 {
150  if ( ! obj->drawer()->shown() ) return;
151  assert( mcolormap.find( obj->drawer()->color() ) != mcolormap.end() );
152  mcurcolorid = mcolormap[ obj->drawer()->color() ];
153  mcurobj = obj;
154  obj->imp()->visit( this );
155 }
156 
157 void XFigExportImpVisitor::visit( const LineImp* imp )
158 {
159  Coordinate a = imp->data().a;
160  Coordinate b = imp->data().b;
161  calcBorderPoints( a, b, msr );
162  int width = mcurobj->drawer()->width();
163  if ( width == -1 ) width = 1;
164 
165  if ( a != b )
166  emitLine( a, b, width );
167 }
168 
169 void XFigExportImpVisitor::emitLine( const Coordinate& a, const Coordinate& b, int width, bool vector )
170 {
171  mstream << "2 "; // polyline type;
172  mstream << "1 "; // polyline subtype;
173  mstream << "0 "; // line_style: Solid
174  mstream << width << " "; // thickness: *1/80 inch
175  mstream << mcurcolorid << " "; // pen_color: default
176  mstream << "7 "; // fill_color: white
177  mstream << "50 "; // depth: 50
178  mstream << "-1 "; // pen_style: unused by XFig
179  mstream << "-1 "; // area_fill: no fill
180  mstream << "0.000 "; // style_val: the distance between dots and
181  // dashes in case of dotted or dashed lines..
182  mstream << "0 "; // join_style: Miter
183  mstream << "0 "; // cap_style: Butt
184  mstream << "-1 "; // radius in case of an arc-box, but we're a
185  // polyline, so nothing here..
186  if ( ! vector )
187  mstream << "0 "; // forward arrow: no
188  else
189  mstream << "1 "; // forward arrow: yes
190  mstream << "0 "; // backward arrow: no
191  mstream << "2"; // a two points polyline..
192 
193  mstream << "\n\t ";
194 
195  if ( vector )
196  {
197  // first the arrow line in case of a vector..
198  mstream << "1 " // arrow_type: closed triangle
199  << "1 " // arrow_style: filled with pen color..
200  << "1.00 " // arrow_thickness: 1
201  << "195.00 " // arrow_width
202  << "165.00 " // arrow_height
203  << "\n\t";
204  }
205  QPoint ca = convertCoord( a );
206  QPoint cb = convertCoord( b );
207 
208  mstream << ca.x() << " " << ca.y() << " " << cb.x() << " " << cb.y() << "\n";
209 }
210 
211 void XFigExportImpVisitor::visit( const PointImp* imp )
212 {
213  const QPoint center = convertCoord( imp->coordinate() );
214  int width = mcurobj->drawer()->width();
215  if ( width == -1 ) width = 5;
216  width *= 10;
217 
218  mstream << "1 " // Ellipse type
219  << "3 " // circle defined by radius subtype
220  << "0 "; // line_style: Solid
221  mstream << "1 " << " " // thickness: *1/80 inch
222  << mcurcolorid << " " // pen_color: default
223  << mcurcolorid << " " // fill_color: black
224  << "50 " // depth: 50
225  << "-1 " // pen_style: unused by XFig
226  << "20 " // area_fill: full saturation of the fill color
227  << "0.000 " // style_val: the distance between dots and
228  // dashes in case of dotted or dashed lines..
229  << "1 " // direction: always 1
230  << "0.0000 " // angle: the radius of the x-axis: 0
231  << center.x() << " " << center.y() << " " // the center..
232  << width << " " << width << " " // radius_x and radius_y
233  << center.x() << " " // start_x and start_y, appear
234  << center.y() << " " // unused..
235  << center.x() + width << " " // end_x and end_y,
236  << center.y() << "\n"; // appear unused too...
237 }
238 
239 void XFigExportImpVisitor::visit( const TextImp* imp )
240 {
241  QString text = imp->text();
242  QPoint coord = convertCoord( imp->surroundingRect().bottomLeft() );
243 
244  mstream << "4 " // text type
245  << "0 " // subtype: left justfied
246  << mcurcolorid << " " // color: black
247  << "50 " // depth: 50
248  << "-1 " // pen style: unused
249  << "0 " // font: default
250  << "11 " // font-size: 11
251  << "0 " // angle
252  << "0 " // font-flags: all the defaults..
253  << "500 500 " // height, width: large enough..
254  << coord.x() << " " // x, y
255  << coord.y() << " "
256  << text.toAscii() << "\\001" // text, terminated by \001
257  << "\n";
258 }
259 
260 void XFigExportImpVisitor::visit( const AngleImp* )
261 {
262 }
263 
264 void XFigExportImpVisitor::visit( const VectorImp* imp )
265 {
266  int width = mcurobj->drawer()->width();
267  if ( width == -1 ) width = 1;
268  emitLine( imp->a(), imp->b(), width, true );
269 }
270 
271 void XFigExportImpVisitor::visit( const LocusImp* )
272 {
273 
274 }
275 
276 void XFigExportImpVisitor::visit( const CircleImp* imp )
277 {
278  const QPoint center = convertCoord( imp->center() );
279  const int radius =
280  ( convertCoord( imp->center() + Coordinate( imp->radius(), 0 ) ) - center ).x();
281 
282  mstream << "1 " // Ellipse type
283  << "3 " // circle defined by radius subtype
284  << "0 "; // line_style: Solid
285  int width = mcurobj->drawer()->width();
286  if ( width == -1 ) width = 1;
287  mstream << width << " " // thickness: *1/80 inch
288  << mcurcolorid << " " // pen_color: default
289  << "7 " // fill_color: white
290  << "50 " // depth: 50
291  << "-1 " // pen_style: unused by XFig
292  << "-1 " // area_fill: no fill
293  << "0.000 " // style_val: the distance between dots and
294  // dashes in case of dotted or dashed lines..
295  << "1 " // direction: always 1
296  << "0.0000 " // angle: the radius of the x-axis: 0
297  << center.x() << " " << center.y() << " " // the center..
298  << radius << " " << radius << " " // radius_x and radius_y
299  << center.x() << " " // start_x and start_y, appear
300  << center.y() << " " // unused..
301  << center.x() + radius << " " // end_x and end_y,
302  << center.y() << "\n"; // appear unused too...
303 }
304 
305 void XFigExportImpVisitor::visit( const ConicImp* imp )
306 {
307  int width = mcurobj->drawer()->width();
308  if ( width == -1 ) width = 1;
309  if ( imp->conicType() == 1 )
310  {
311  // an ellipse, this is good, cause this allows us to export to a
312  // real ellipse type..
313  const ConicPolarData data = imp->polarData();
314 
315  // gather some necessary data..
316  // the angle of the x axis..
317  double anglex = atan2( data.esintheta0, data.ecostheta0 );
318  // the exentricity
319  double e = hypot( data.esintheta0, data.ecostheta0 );
320  // the x radius is easy to find..
321  double radiusx = data.pdimen / ( 1 - e * e );
322  // the y radius is a bit harder: we first find the distance from
323  // the focus point to the mid point of the two focuses, this is:
324  double d = -e * data.pdimen / ( 1 - e * e );
325  // the distance from the first focus to the intersection of the
326  // second axis with the conic equals radiusx:
327  double r = radiusx;
328  double radiusy = sqrt( r*r - d*d );
329 
330  Coordinate center = data.focus1 - Coordinate( cos( anglex ), sin( anglex ) ).normalize( d );
331  const QPoint qcenter = convertCoord( center );
332  const int radius_x = ( convertCoord( center + Coordinate( radiusx, 0 ) ) -
333  convertCoord( center ) ).x();
334  const int radius_y = ( convertCoord( center + Coordinate( radiusy, 0 ) ) -
335  convertCoord( center ) ).x();
336  const QPoint qpoint2 = convertCoord( center + Coordinate( -sin( anglex ), cos( anglex ) ) * radiusy );
337 
338  mstream << "1 " // ellipse type
339  << "1 " // subtype: ellipse defined by readii
340  << "0 " // line_style: Solid
341  << width << " " // thickness
342  << mcurcolorid << " " // pen_color: black
343  << "7 " // fill_color: white
344  << "50 " // depth: 50
345  << "-1 " // pan_style: not used
346  << "-1 " // area_fill: no fill
347  << "0.000 " // style_val: not used
348  << "1 " // direction: always 1
349  << anglex << " " // angle of the main axis
350  << qcenter.x() << " " // center
351  << qcenter.y() << " "
352  << radius_x << " " // radiuses
353  << radius_y << " "
354  << qcenter.x() << " " // start point
355  << qcenter.y() << " "
356  << qpoint2.x() << " " // end point
357  << qpoint2.y() << " ";
358  }
359  else return;
360 }
361 
362 void XFigExportImpVisitor::visit( const CubicImp* )
363 {
364 }
365 
366 void XFigExportImpVisitor::visit( const SegmentImp* imp )
367 {
368  Coordinate a = imp->data().a;
369  Coordinate b = imp->data().b;
370  int width = mcurobj->drawer()->width();
371  if ( width == -1 ) width = 1;
372 
373  emitLine( a, b, width );
374 }
375 
376 void XFigExportImpVisitor::visit( const RayImp* imp )
377 {
378  Coordinate a = imp->data().a;
379  Coordinate b = imp->data().b;
380  calcRayBorderPoints( a, b, msr );
381 
382  int width = mcurobj->drawer()->width();
383  if ( width == -1 ) width = 1;
384 
385  emitLine( a, b, width );
386 }
387 
388 void XFigExportImpVisitor::visit( const ArcImp* imp )
389 {
390  const Coordinate center = imp->center();
391  const double radius = imp->radius();
392  const double startangle = imp->startAngle();
393  const double endangle = startangle + imp->angle();
394  const double middleangle = ( startangle + endangle ) / 2;
395  const Coordinate ad = Coordinate( cos( startangle ), sin( startangle ) ).normalize( radius );
396  const Coordinate bd = Coordinate( cos( middleangle ), sin( middleangle ) ).normalize( radius );
397  const Coordinate cd = Coordinate( cos( endangle ), sin( endangle ) ).normalize( radius );
398  const QPoint a = convertCoord( center + ad );
399  const QPoint b = convertCoord( center + bd );
400  const QPoint c = convertCoord( center + cd );
401  const QPoint cent = convertCoord( center );
402 
403  mstream << "5 " // Ellipse type
404  << "1 " // subtype: open ended arc
405  << "0 "; // line_style: Solid
406  int width = mcurobj->drawer()->width();
407  if ( width == -1 ) width = 1;
408  mstream << width << " " // thickness: *1/80 inch
409  << mcurcolorid << " " // pen_color: default
410  << "7 " // fill_color: white
411  << "50 " // depth: 50
412  << "-1 " // pen_style: unused by XFig
413  << "-1 " // area_fill: no fill
414  << "0.000 " // style_val: the distance between dots and
415  // dashes in case of dotted or dashed lines..
416  << "0 "; // cap_style: Butt..
417  // 0 is clockwise, 1 is counterclockwise .
418  int direction = imp->angle() > 0 ? 1 : 0;
419  // direction next
420  mstream << direction << " " // direction..
421  << "0 " // forward_arrow: no
422  << "0 " // backward_arrow: no
423  << cent.x() << " " << cent.y() << " " // the center..
424  << a.x() << " " << a.y() << " " // x1, y1
425  << b.x() << " " << b.y() << " " // x2, y2
426  << c.x() << " " << c.y() << " " // x3, y3
427  << "\n";
428 }
429 
430 void XFigExportImpVisitor::visit( const FilledPolygonImp* imp )
431 {
432  int width = mcurobj->drawer()->width();
433  if ( width == -1 ) width = 1;
434  const std::vector<Coordinate> oldpts = imp->points();
435  // it has n points, but the first point is counted twice (ie. as ending too)
436  std::vector<Coordinate> pts;
437  std::copy( oldpts.begin(), oldpts.end(), std::back_inserter( pts ) );
438  pts.push_back( pts[0] );
439  mstream << "2 "; // polyline type;
440  mstream << "3 "; // polygon subtype;
441  mstream << "0 "; // line_style: Solid
442  mstream << width << " "; // thickness: *1/80 inch
443  mstream << mcurcolorid << " "; // pen_color: our color
444  mstream << mcurcolorid << " "; // fill_color: our color
445  mstream << "50 "; // depth: 50
446  mstream << "-1 "; // pen_style: unused by XFig
447  mstream << "10 "; // area_fill: 50% of opacity
448  mstream << "0.000 "; // style_val: the distance between dots and
449  // dashes in case of dotted or dashed lines..
450  mstream << "0 "; // join_style: Miter
451  mstream << "0 "; // cap_style: Butt
452  mstream << "-1 "; // radius in case of an arc-box, but we're a
453  // polygon, so nothing here..
454  mstream << "0 "; // forward arrow: no
455  mstream << "0 "; // backward arrow: no
456  mstream << pts.size(); // it has n (well, n+1) points
457  mstream << "\n";
458 
459  // write the list of points, max 6 per line..
460  bool in_line = false;
461  for ( uint i = 0; i < pts.size(); ++i )
462  {
463  int m = i % 6;
464  if ( m == 0 )
465  {
466  in_line = true;
467  mstream << "\t";
468  }
469  QPoint p = convertCoord( pts[i] );
470  mstream << " " << p.x() << " " << p.y();
471  if ( m == 5 )
472  {
473  in_line = false;
474  mstream << "\n";
475  }
476  }
477  if ( in_line )
478  mstream << "\n";
479 }
480 
481 void XFigExportImpVisitor::visit(const ClosedPolygonalImp* imp)
482 {
483  int width = mcurobj->drawer()->width();
484  if ( width == -1 ) width = 1;
485  const std::vector<Coordinate> oldpts = imp->points();
486  // it has n points, but the first point is counted twice (ie. as ending too)
487  std::vector<Coordinate> pts;
488  std::copy( oldpts.begin(), oldpts.end(), std::back_inserter( pts ) );
489  pts.push_back( pts[0] );
490  mstream << "2 "; // polyline type;
491  mstream << "3 "; // polygon subtype;
492  mstream << "0 "; // line_style: Solid
493  mstream << width << " "; // thickness: *1/80 inch
494  mstream << mcurcolorid << " "; // pen_color: our color
495  mstream << mcurcolorid << " "; // fill_color: our color
496  mstream << "50 "; // depth: 50
497  mstream << "-1 "; // pen_style: unused by XFig
498  mstream << "20 "; // area_fill: 0% of opacity
499  mstream << "0.000 "; // style_val: the distance between dots and
500  // dashes in case of dotted or dashed lines..
501  mstream << "0 "; // join_style: Miter
502  mstream << "0 "; // cap_style: Butt
503  mstream << "-1 "; // radius in case of an arc-box, but we're a
504  // polygon, so nothing here..
505  mstream << "0 "; // forward arrow: no
506  mstream << "0 "; // backward arrow: no
507  mstream << pts.size(); // it has n (well, n+1) points
508  mstream << "\n";
509 
510  // write the list of points, max 6 per line..
511  bool in_line = false;
512  for ( uint i = 0; i < pts.size(); ++i )
513  {
514  int m = i % 6;
515  if ( m == 0 )
516  {
517  in_line = true;
518  mstream << "\t";
519  }
520  QPoint p = convertCoord( pts[i] );
521  mstream << " " << p.x() << " " << p.y();
522  if ( m == 5 )
523  {
524  in_line = false;
525  mstream << "\n";
526  }
527  }
528  if ( in_line )
529  mstream << "\n";
530 }
531 void XFigExportImpVisitor::visit(const OpenPolygonalImp* imp)
532 {
533  int width = mcurobj->drawer()->width();
534  if ( width == -1 ) width = 1;
535  const std::vector<Coordinate> pts = imp->points();
536  mstream << "2 "; // polyline type;
537  mstream << "3 "; // polygon subtype;
538  mstream << "0 "; // line_style: Solid
539  mstream << width << " "; // thickness: *1/80 inch
540  mstream << mcurcolorid << " "; // pen_color: our color
541  mstream << mcurcolorid << " "; // fill_color: our color
542  mstream << "50 "; // depth: 50
543  mstream << "-1 "; // pen_style: unused by XFig
544  mstream << "20 "; // area_fill: 0% of opacity
545  mstream << "0.000 "; // style_val: the distance between dots and
546  // dashes in case of dotted or dashed lines..
547  mstream << "0 "; // join_style: Miter
548  mstream << "0 "; // cap_style: Butt
549  mstream << "-1 "; // radius in case of an arc-box, but we're a
550  // polygon, so nothing here..
551  mstream << "0 "; // forward arrow: no
552  mstream << "0 "; // backward arrow: no
553  mstream << pts.size(); // it has n (well, n+1) points
554  mstream << "\n";
555 
556  // write the list of points, max 6 per line..
557  bool in_line = false;
558  for ( uint i = 0; i < pts.size(); ++i )
559  {
560  int m = i % 6;
561  if ( m == 0 )
562  {
563  in_line = true;
564  mstream << "\t";
565  }
566  QPoint p = convertCoord( pts[i] );
567  mstream << " " << p.x() << " " << p.y();
568  if ( m == 5 )
569  {
570  in_line = false;
571  mstream << "\n";
572  }
573  }
574  if ( in_line )
575  mstream << "\n";
576 }
577 
578 void XFigExporter::run( const KigPart& doc, KigWidget& w )
579 {
580  KigFileDialog* kfd = new KigFileDialog(
581  ":document", i18n( "*.fig|XFig Documents (*.fig)" ),
582  i18n( "Export as XFig File" ), &w );
583  if ( !kfd->exec() )
584  return;
585 
586  QString file_name = kfd->selectedFile();
587 
588  delete kfd;
589 
590  QFile file( file_name );
591  if ( ! file.open( QIODevice::WriteOnly ) )
592  {
593  KMessageBox::sorry( &w, i18n( "The file \"%1\" could not be opened. Please "
594  "check if the file permissions are set correctly." ,
595  file_name ) );
596  return;
597  };
598  QTextStream stream( &file );
599  stream << "#FIG 3.2 Produced by Kig\n";
600  stream << "Landscape\n";
601  stream << "Center\n";
602  stream << "Metric\n";
603  stream << "A4\n";
604  stream << "100.00\n";
605  stream << "Single\n";
606  stream << "-2\n";
607  stream << "1200 2\n";
608 
609  std::vector<ObjectHolder*> os = doc.document().objects();
610  XFigExportImpVisitor visitor( stream, w );
611 
612  for ( std::vector<ObjectHolder*>::const_iterator i = os.begin();
613  i != os.end(); ++i )
614  {
615  visitor.mapColor( ( *i )->drawer() );
616  };
617 
618  for ( std::vector<ObjectHolder*>::const_iterator i = os.begin();
619  i != os.end(); ++i )
620  {
621  visitor.visit( *i );
622  };
623 }
calcRayBorderPoints
void calcRayBorderPoints(const Coordinate &a, Coordinate &b, const Rect &r)
this does the same as the above function, but only for b.
Definition: common.cpp:131
ClosedPolygonalImp
An ObjectImp representing a closed polygonal.
Definition: polygon_imp.h:130
TextImp::surroundingRect
Rect surroundingRect() const
Definition: text_imp.cc:170
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
AbstractLineImp::data
LineData data() const
Get the LineData for this AbstractLineImp.
Definition: line_imp.cc:359
Coordinate::toQPoint
QPoint toQPoint() const
Definition: coordinate.cpp:165
ConicPolarData::esintheta0
double esintheta0
The esintheta0 value from the polar equation.
Definition: conic-common.h:118
OpenPolygonalImp
An ObjectImp representing an open polygonal.
Definition: polygon_imp.h:157
ObjectDrawer::shown
bool shown() const
returns whether the object this ObjectDrawer is responsible for will be drawn or not.
Definition: object_drawer.cc:52
KigFileDialog
This file dialog is pretty like KFileDialog, but allow us to make an option widget popup to the user...
Definition: kigfiledialog.h:27
LineData::b
Coordinate b
Another point on the line.
Definition: misc/common.h:68
ObjectImpVisitor::visit
void visit(const ObjectImp *imp)
Definition: object_imp.cc:81
CircleImp
An ObjectImp representing a circle.
Definition: circle_imp.h:27
Rect::bottomLeft
Coordinate bottomLeft() const
Definition: rect.cc:161
ObjectImp::visit
virtual void visit(ObjectImpVisitor *vtor) const =0
TextImp
Definition: text_imp.h:26
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
KigPart::document
const KigDocument & document() const
Definition: kig_part.cpp:989
CircleImp::center
const Coordinate center() const
Return the center of this circle.
Definition: circle_imp.cc:210
ObjectHolder::drawer
const ObjectDrawer * drawer() const
Definition: object_holder.cc:58
PointImp::coordinate
const Coordinate & coordinate() const
Get the coordinate of this PointImp.
Definition: point_imp.h:50
XFigExporter::exportToStatement
QString exportToStatement() const
Returns a statement like i18n( "Export to image" )
Definition: xfigexporter.cc:58
AbstractPolygonImp::points
const std::vector< Coordinate > points() const
Returns the vector with polygon points.
Definition: polygon_imp.cc:571
XFigExporter::run
void run(const KigPart &doc, KigWidget &w)
Do what you need to do.
Definition: xfigexporter.cc:578
ArcImp::radius
double radius() const
Return the radius of this arc.
Definition: other_imp.cc:537
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
Coordinate::normalize
const Coordinate normalize(double length=1) const
Normalize.
Definition: coordinate.cpp:154
TextImp::text
QString text() const
Definition: text_imp.cc:115
ArcImp::angle
double angle() const
Return the dimension in radians of this arc.
Definition: other_imp.cc:547
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
ConicPolarData::focus1
Coordinate focus1
The first focus of this conic.
Definition: conic-common.h:106
LineData::a
Coordinate a
One point on the line.
Definition: misc/common.h:64
ConicPolarData::pdimen
double pdimen
The pdimen value from the polar equation.
Definition: conic-common.h:110
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
ConicPolarData::ecostheta0
double ecostheta0
The ecostheta0 value from the polar equation.
Definition: conic-common.h:114
KigDocument::objects
const std::vector< ObjectHolder * > objects() const
Get a hold of the objects of this KigDocument.
Definition: kig_document.cc:46
ConicImp
An ObjectImp representing a conic.
Definition: conic_imp.h:39
XFigExporter::~XFigExporter
~XFigExporter()
Definition: xfigexporter.cc:54
ArcImp::center
const Coordinate center() const
Return the center of this arc.
Definition: other_imp.cc:532
ObjectHolder::imp
const ObjectImp * imp() const
Definition: object_holder.cc:48
ArcImp::startAngle
double startAngle() const
Return the start angle in radians of this arc.
Definition: other_imp.cc:542
VectorImp::a
const Coordinate a() const
Return the start point of this vector.
Definition: other_imp.cc:564
ObjectDrawer
A class holding some information about how a certain object is drawn on the window.
Definition: object_drawer.h:47
ConicImp::polarData
virtual const ConicPolarData polarData() const =0
Return the polar representation of this conic.
CircleImp::radius
double radius() const
Return the radius of this circle.
Definition: circle_imp.cc:215
visit
static bool visit(const ObjectCalcer *o, const std::vector< ObjectCalcer * > &from, std::vector< ObjectCalcer * > &ret)
Definition: calcpaths.cc:193
calcBorderPoints
void calcBorderPoints(Coordinate &p1, Coordinate &p2, const Rect &r)
this sets p1 and p2 to p1' and p2' so that p1'p2' is the same line as p1p2, and so that p1' and p2' a...
Definition: common.cpp:82
XFigExporter::menuEntryName
QString menuEntryName() const
Returns a string like i18n( "Image..." )
Definition: xfigexporter.cc:64
operator<
static bool operator<(const QColor &a, const QColor &b)
Definition: xfigexporter.cc:49
xfigexporter.h
ConicImp::conicType
virtual int conicType() const
Type of conic.
Definition: conic_imp.cc:191
LineImp
An ObjectImp representing a line.
Definition: line_imp.h:184
ArcImp
An ObjectImp representing an arc.
Definition: other_imp.h:169
ObjectDrawer::color
QColor color() const
returns the color that the object will be drawn in
Definition: object_drawer.cc:57
Coordinate::y
double y
Y Component.
Definition: coordinate.h:129
KigPart
This is a "Part".
Definition: kig_part.h:68
VectorImp::b
const Coordinate b() const
Return the end point of this vector.
Definition: other_imp.cc:569
XFigExporter::menuIcon
QString menuIcon() const
Returns a string with the name of the icon.
Definition: xfigexporter.cc:69
FilledPolygonImp
An ObjectImp representing a filled polygon.
Definition: polygon_imp.h:101
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
ConicPolarData
This class represents an equation of a conic in the form .
Definition: conic-common.h:85
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:40 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