Add some commands to assembly
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include "FeatureMirroring.h"
|
||||
#include "FeatureRevolution.h"
|
||||
#include "PartFeatures.h"
|
||||
#include "Body.h"
|
||||
#include "PrimitiveFeature.h"
|
||||
#include "Part2DObject.h"
|
||||
#include "CustomFeature.h"
|
||||
@@ -218,6 +219,7 @@ PyMODINIT_FUNC initPart()
|
||||
|
||||
Part::Feature ::init();
|
||||
Part::FeatureExt ::init();
|
||||
Part::Body ::init();
|
||||
Part::FeaturePython ::init();
|
||||
Part::FeatureGeometrySet ::init();
|
||||
Part::CustomFeature ::init();
|
||||
|
||||
60
src/Mod/Part/App/Body.cpp
Normal file
60
src/Mod/Part/App/Body.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2010 Juergen Riegel <FreeCAD@juergen-riegel.net> *
|
||||
* *
|
||||
* 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 *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
#endif
|
||||
|
||||
#include <Base/Placement.h>
|
||||
|
||||
#include "Body.h"
|
||||
|
||||
|
||||
using namespace Part;
|
||||
|
||||
namespace Part {
|
||||
|
||||
|
||||
PROPERTY_SOURCE(Part::Body, Part::Feature)
|
||||
|
||||
Body::Body()
|
||||
{
|
||||
ADD_PROPERTY(Model,(0));
|
||||
ADD_PROPERTY(Tip ,(0));
|
||||
}
|
||||
|
||||
short Body::mustExecute() const
|
||||
{
|
||||
//if (Sketch.isTouched() ||
|
||||
// Length.isTouched())
|
||||
// return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *Body::execute(void)
|
||||
{
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
|
||||
}
|
||||
64
src/Mod/Part/App/Body.h
Normal file
64
src/Mod/Part/App/Body.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2010 Juergen Riegel <FreeCAD@juergen-riegel.net> *
|
||||
* *
|
||||
* 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 PART_Body_H
|
||||
#define PART_Body_H
|
||||
|
||||
#include <App/PropertyStandard.h>
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
|
||||
|
||||
namespace Part
|
||||
{
|
||||
/** Base class of all body objects in FreeCAD
|
||||
* A body is used, e.g. in PartDesign, to agregate
|
||||
* some modeling features to one shape. As long as not
|
||||
* in edit or active on a workbench, the body shows only the
|
||||
* resulting shape to the outside (Tip link).
|
||||
*/
|
||||
class PartExport Body : public Part::Feature
|
||||
{
|
||||
PROPERTY_HEADER(PartDesign::Body);
|
||||
|
||||
public:
|
||||
Body();
|
||||
|
||||
App::PropertyLinkList Model;
|
||||
App::PropertyLink Tip;
|
||||
|
||||
/** @name methods override feature */
|
||||
//@{
|
||||
/// recalculate the feature
|
||||
App::DocumentObjectExecReturn *execute(void);
|
||||
short mustExecute() const;
|
||||
/// returns the type name of the view provider
|
||||
//const char* getViewProviderName(void) const {
|
||||
// return "PartDesignGui::ViewProviderBody";
|
||||
//}
|
||||
//@}
|
||||
};
|
||||
|
||||
} //namespace Part
|
||||
|
||||
|
||||
#endif // PART_Body_H
|
||||
@@ -134,6 +134,8 @@ SET(Features_SRCS
|
||||
FeatureGeometrySet.cpp
|
||||
CustomFeature.cpp
|
||||
CustomFeature.h
|
||||
Body.h
|
||||
Body.cpp
|
||||
)
|
||||
SOURCE_GROUP("Features" FILES ${Features_SRCS})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user