Constraint.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) Jürgen Riegel          (juergen.riegel@web.de) 2008     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef SKETCHER_CONSTRAINT_H
00025 #define SKETCHER_CONSTRAINT_H
00026 
00027 
00028 #include <Base/Persistence.h>
00029 
00030 namespace Sketcher
00031 {
00032 
00033 enum ConstraintType {
00034     None,
00035     Coincident,
00036     Horizontal,
00037     Vertical,
00038     Parallel,
00039     Tangent,
00040     Distance,
00041     DistanceX,
00042     DistanceY,
00043     Angle,
00044     Perpendicular,
00045     Radius,
00046     Equal,
00047     PointOnObject,
00048     Symmetric
00049 };
00050 
00052 enum PointPos { none, start, end, mid };
00053 
00054 class SketcherExport Constraint :public Base::Persistence
00055 {
00056     TYPESYSTEM_HEADER();
00057 
00058 public:
00059     ~Constraint();
00060     Constraint();
00061     Constraint(const Constraint&);
00062     virtual Constraint *clone(void)const;
00063 
00064     static const int GeoUndef;
00065 
00066     // from base class
00067     virtual unsigned int getMemSize(void) const;
00068     virtual void Save(Base::Writer &/*writer*/) const;
00069     virtual void Restore(Base::XMLReader &/*reader*/);
00070 
00071     virtual PyObject *getPyObject(void);
00072 
00073     friend class Sketch;
00074 
00075 public:
00076     ConstraintType Type;
00077     std::string Name;
00078     double Value;
00079     int First;
00080     PointPos FirstPos;
00081     int Second;
00082     PointPos SecondPos;
00083     int Third;
00084     PointPos ThirdPos;
00085     float LabelDistance;
00086 };
00087 
00088 } //namespace Part
00089 
00090 
00091 #endif // SKETCHER_CONSTRAINT_H

Generated on Wed Nov 23 19:00:04 2011 for FreeCAD by  doxygen 1.6.1