add basic part design pipe infrastructure
This commit is contained in:
104
src/Mod/PartDesign/App/FeaturePipe.cpp
Normal file
104
src/Mod/PartDesign/App/FeaturePipe.cpp
Normal file
@@ -0,0 +1,104 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2015 Stefan Tröger <stefantroeger@gmx.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_
|
||||
# include <BRep_Builder.hxx>
|
||||
# include <BRep_Tool.hxx>
|
||||
# include <BRepBndLib.hxx>
|
||||
# include <BRepFeat_MakePrism.hxx>
|
||||
# include <BRepBuilderAPI_MakeFace.hxx>
|
||||
# include <Handle_Geom_Surface.hxx>
|
||||
# include <TopoDS.hxx>
|
||||
# include <TopoDS_Solid.hxx>
|
||||
# include <TopoDS_Face.hxx>
|
||||
# include <TopoDS_Wire.hxx>
|
||||
# include <TopExp_Explorer.hxx>
|
||||
# include <BRepAlgoAPI_Fuse.hxx>
|
||||
# include <Precision.hxx>
|
||||
# include <BRepPrimAPI_MakeHalfSpace.hxx>
|
||||
# include <BRepAlgoAPI_Common.hxx>
|
||||
# include <BRepAdaptor_Surface.hxx>
|
||||
# include <gp_Pln.hxx>
|
||||
# include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Placement.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Reader.h>
|
||||
#include <App/Document.h>
|
||||
|
||||
//#include "Body.h"
|
||||
#include "FeaturePipe.h"
|
||||
|
||||
|
||||
using namespace PartDesign;
|
||||
|
||||
const char* Pipe::TypeEnums[] = {"FullPath","UpToFace",NULL};
|
||||
const char* Pipe::TransitionEnums[] = {"Transformed","Right corner", "Round corner",NULL};
|
||||
const char* Pipe::ModeEnums[] = {"Standart", "Fixed", "Binormal", "Frenet", NULL};
|
||||
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Pipe, PartDesign::SketchBased)
|
||||
|
||||
Pipe::Pipe()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(Sections,(0),"Sweep",App::Prop_None,"List of sections");
|
||||
Sections.setSize(0);
|
||||
ADD_PROPERTY_TYPE(Spine,(0,0),"Sweep",App::Prop_None,"Path to sweep along");
|
||||
ADD_PROPERTY_TYPE(Mode,(long(1)),"Sweep",App::Prop_None,"Profile mode");
|
||||
ADD_PROPERTY_TYPE(Transition,(long(1)),"Sweep",App::Prop_None,"Transition mode");
|
||||
Transition.setEnums(TransitionEnums);
|
||||
}
|
||||
|
||||
short Pipe::mustExecute() const
|
||||
{
|
||||
if (Sections.isTouched())
|
||||
return 1;
|
||||
if (Spine.isTouched())
|
||||
return 1;
|
||||
if (Mode.isTouched())
|
||||
return 1;
|
||||
if (Transition.isTouched())
|
||||
return 1;
|
||||
return SketchBased::mustExecute();
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *Pipe::execute(void)
|
||||
{
|
||||
|
||||
return SketchBased::execute();
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::AdditivePipe, PartDesign::Pipe)
|
||||
AdditivePipe::AdditivePipe() {
|
||||
addSubType = Additive;
|
||||
}
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::SubtractivePipe, PartDesign::Pipe)
|
||||
SubtractivePipe::SubtractivePipe() {
|
||||
addSubType = Subtractive;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user