/*************************************************************************** * Copyright (c) 2013 Luke Parry * * * * This file is part of the FreeCAD CAx development system. * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * * License as published by the Free Software Foundation; either * * version 2 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef MEASURE_MEASUREMENT_H #define MEASURE_MEASUREMENT_H #include #include #include #include class TopoDS_Shape; namespace Measure { enum MeasureType { Volumes, // Measure the Volume(s) Edges, // Measure the Edge(s) Surfaces, // Measure the surface(s) Points, PointToPoint, // Measure between TWO points PointToEdge, // Measure between ONE point and ONE edge PointToSurface, // Measure between ONE point and ONE surface EdgeToEdge, // Measure between TWO edges Invalid }; class MeasureExport Measurement : public Base::BaseClass { TYPESYSTEM_HEADER(); public: App::PropertyLinkSubList References3D; public: Measurement(); ~Measurement(); void clear(); bool has3DReferences(); /// Add a reference int addReference3D(App::DocumentObject* obj, const std::string& subName); int addReference3D(App::DocumentObject* obj, const char *subName); MeasureType getType(); // from base class virtual PyObject *getPyObject(void); virtual unsigned int getMemSize(void) const; public: // Methods for distances (edge length, two points, edge and a point double length() const; Base::Vector3d delta() const; //when would client use delta?? // Calculates the radius for an arc or circular edge double radius() const; // Calculates the angle between two edges double angle(const Base::Vector3d ¶m = Base::Vector3d(0,0,0)) const; //param is never used??? // Calculate volumetric/mass properties Base::Vector3d massCenter() const; protected: TopoDS_Shape getShape(App::DocumentObject *obj , const char *subName) const; MeasureType measureType; Py::Object PythonObject; }; } //namespace measure #endif // MEASURE_MEASUREMENT_H