+ unify DLL export defines to namespace names

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer
2011-10-10 13:44:52 +00:00
commit 120ca87015
4155 changed files with 2965978 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 <Python.h>
#endif
#include <Base/Console.h>
#include <Base/Interpreter.h>
#include "Points.h"
#include "PointsPy.h"
#include "Properties.h"
#include "PropertyPointKernel.h"
#include "FeaturePointsImportAscii.h"
/* registration table */
extern struct PyMethodDef Points_Import_methods[];
/* Python entry */
extern "C" {
void PointsExport initPoints()
{
PyObject* pointsModule = Py_InitModule("Points", Points_Import_methods); /* mod name, table ptr */
Base::Console().Log("Loading Points module... done\n");
// add python types
Base::Interpreter().addType(&Points::PointsPy ::Type,pointsModule,"Points");
// add properties
Points::PropertyGreyValue ::init();
Points::PropertyGreyValueList ::init();
Points::PropertyNormalList ::init();
Points::PropertyCurvatureList ::init();
Points::PropertyPointKernel ::init();
// add data types
Points::Feature ::init();
Points::FeaturePython ::init();
Points::Export ::init();
Points::ImportAscii ::init();
}
} // extern "C"

View File

@@ -0,0 +1,142 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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/Console.h>
#include <Base/Interpreter.h>
#include <Base/FileInfo.h>
#include <App/Application.h>
#include <App/Document.h>
#include <App/DocumentObject.h>
#include <App/Property.h>
#include "Points.h"
#include "PointsPy.h"
#include "PointsAlgos.h"
#include "FeaturePointsImportAscii.h"
using namespace Points;
/* module functions */
static PyObject *
open(PyObject *self, PyObject *args)
{
const char* Name;
if (! PyArg_ParseTuple(args, "s",&Name))
return NULL;
PY_TRY {
Base::Console().Log("Open in Points with %s",Name);
Base::FileInfo file(Name);
// extract ending
if (file.extension() == "")
Py_Error(PyExc_Exception,"no file ending");
if (file.hasExtension("asc")) {
// create new document and add Import feature
App::Document *pcDoc = App::GetApplication().newDocument("Unnamed");
Points::Feature *pcFeature = (Points::Feature *)pcDoc->addObject("Points::Feature", file.fileNamePure().c_str());
Points::PointKernel pkTemp;
pkTemp.load(Name);
pcFeature->Points.setValue( pkTemp );
}
else {
Py_Error(PyExc_Exception,"unknown file ending");
}
} PY_CATCH;
Py_Return;
}
static PyObject *
insert(PyObject *self, PyObject *args)
{
const char* Name;
const char* DocName;
if (!PyArg_ParseTuple(args, "ss",&Name,&DocName))
return NULL;
PY_TRY {
Base::Console().Log("Import in Points with %s",Name);
Base::FileInfo file(Name);
// extract ending
if (file.extension() == "")
Py_Error(PyExc_Exception,"no file ending");
if (file.hasExtension("asc")) {
// add Import feature
App::Document *pcDoc = App::GetApplication().getDocument(DocName);
if (!pcDoc) {
pcDoc = App::GetApplication().newDocument(DocName);
}
Points::Feature *pcFeature = (Points::Feature *)pcDoc->addObject("Points::Feature", file.fileNamePure().c_str());
Points::PointKernel pkTemp;
pkTemp.load(Name);
pcFeature->Points.setValue( pkTemp );
}
else {
Py_Error(PyExc_Exception,"unknown file ending");
}
} PY_CATCH;
Py_Return;
}
static PyObject *
show(PyObject *self, PyObject *args)
{
PyObject *pcObj;
if (!PyArg_ParseTuple(args, "O!", &(PointsPy::Type), &pcObj)) // convert args: Python->C
return NULL; // NULL triggers exception
PY_TRY {
App::Document *pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
pcDoc = App::GetApplication().newDocument();
PointsPy* pPoints = static_cast<PointsPy*>(pcObj);
Points::Feature *pcFeature = (Points::Feature *)pcDoc->addObject("Points::Feature", "Points");
// copy the data
//TopoShape* shape = new MeshObject(*pShape->getTopoShapeObjectPtr());
pcFeature->Points.setValue(*(pPoints->getPointKernelPtr()));
//pcDoc->recompute();
} PY_CATCH;
Py_Return;
}
// registration table
struct PyMethodDef Points_Import_methods[] = {
{"open", open, 1}, /* method name, C func ptr, always-tuple */
{"insert",insert, 1},
{"show",show, 1},
{NULL, NULL} /* end of table marker */
};

View File

@@ -0,0 +1,64 @@
if(WIN32)
add_definitions(-DFCAppPoints)
endif(WIN32)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_PATH}
${XERCESC_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
)
set(Points_LIBS
FreeCADApp
)
generate_from_xml(PointsPy)
SET(Points_SRCS
AppPoints.cpp
AppPointsPy.cpp
FeaturePointsImportAscii.cpp
FeaturePointsImportAscii.h
Points.cpp
Points.h
PointsPy.xml
PointsPyImp.cpp
PointsAlgos.cpp
PointsAlgos.h
PointsFeature.cpp
PointsFeature.h
PointsGrid.cpp
PointsGrid.h
PreCompiled.cpp
PreCompiled.h
Properties.cpp
Properties.h
PropertyPointKernel.cpp
PropertyPointKernel.h
)
add_library(Points SHARED ${Points_SRCS})
target_link_libraries(Points ${Points_LIBS})
fc_copy_script("Mod/Points" "Points" Init.py)
if(MSVC)
set_target_properties(Points PROPERTIES SUFFIX ".pyd")
set_target_properties(Points PROPERTIES DEBUG_OUTPUT_NAME "Points_d")
set_target_properties(Points PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/Points)
set_target_properties(Points PROPERTIES PREFIX "../")
elseif(MINGW)
set_target_properties(Points PROPERTIES SUFFIX ".pyd")
set_target_properties(Points PROPERTIES DEBUG_OUTPUT_NAME "Points_d")
set_target_properties(Points PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/Points)
set_target_properties(Points PROPERTIES PREFIX "")
else(MSVC)
set_target_properties(Points PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/Points)
set_target_properties(Points PROPERTIES PREFIX "")
endif(MSVC)
install(TARGETS Points DESTINATION lib)

View File

@@ -0,0 +1,69 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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/Console.h>
#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include "PointsAlgos.h"
#include "Points.h"
#include "FeaturePointsImportAscii.h"
using namespace Points;
PROPERTY_SOURCE(Points::ImportAscii, Points::Feature)
ImportAscii::ImportAscii(void)
{
ADD_PROPERTY(FileName,(""));
}
short ImportAscii::mustExecute() const
{
if (FileName.isTouched())
return 1;
return 0;
}
App::DocumentObjectExecReturn *ImportAscii::execute(void)
{
// ask for read permisson
Base::FileInfo fi(FileName.getValue());
if (!fi.isReadable()) {
std::string error = std::string("Cannot open file ") + FileName.getValue();
return new App::DocumentObjectExecReturn(error);
}
PointKernel kernel;
PointsAlgos::Load(kernel,FileName.getValue());
Points.setValue(kernel);
return App::DocumentObject::StdReturn;
}

View File

@@ -0,0 +1,59 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 FEATURE_Points_IMPORT_Ascii_H
#define FEATURE_Points_IMPORT_Ascii_H
#include "PointsFeature.h"
#include <App/PropertyStandard.h>
namespace Points
{
/**
* The FeaturePointsImportAscii class reads the STL Points format
* into the FreeCAD workspace.
* @author Werner Mayer
*/
class ImportAscii : public Points::Feature
{
PROPERTY_HEADER(Points::ImportAscii);
public:
ImportAscii();
App::PropertyString FileName;
/** @name methods overide Feature */
//@{
/// recalculate the Feature
App::DocumentObjectExecReturn *execute(void);
short mustExecute() const;
//@}
};
}
#endif // FEATURE_Points_IMPORT_STL_H

View File

@@ -0,0 +1,79 @@
lib_LTLIBRARIES=libPoints.la Points.la
BUILT_SOURCES=\
PointsPy.cpp
libPoints_la_BUILT=\
PointsPy.h
libPoints_la_SOURCES=\
AppPointsPy.cpp \
FeaturePointsImportAscii.cpp \
Points.cpp \
PointsPyImp.cpp \
PointsAlgos.cpp \
PointsFeature.cpp \
PointsGrid.cpp \
Properties.cpp \
PropertyPointKernel.cpp \
PreCompiled.cpp \
PreCompiled.h
nodist_include_HEADERS=\
$(libPoints_la_BUILT)
include_HEADERS=\
FeaturePointsImportAscii.h \
Points.h \
PointsAlgos.h \
PointsFeature.h \
PointsGrid.h \
Properties.h \
PropertyPointKernel.h
%.cpp: %.xml $(top_srcdir)/src/Tools/generateTemplates/templateClassPyExport.py
$(PYTHON) $(top_srcdir)/src/Tools/generate.py --outputPath $(@D) $<
# the library search path.
libPoints_la_LDFLAGS = -L../../../Base -L../../../App $(all_libraries) \
-version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@
libPoints_la_CPPFLAGS = -DPointsAppExport=
libPoints_la_LIBADD = \
@BOOST_REGEX_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_SYSTEM_LIB@ \
-l@PYTHON_LIB@ \
-lxerces-c \
-lFreeCADBase \
-lFreeCADApp
#--------------------------------------------------------------------------------------
# Loader of libPoints
Points_la_SOURCES=\
AppPoints.cpp
# the library search path.
Points_la_LDFLAGS = $(libPoints_la_LDFLAGS) -module -avoid-version
Points_la_CPPFLAGS = $(libPoints_la_CPPFLAGS)
Points_la_LIBADD = \
$(libPoints_la_LIBADD) \
-lPoints
Points_la_DEPENDENCIES = libPoints.la
#--------------------------------------------------------------------------------------
# set the include path found by configure
AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src $(all_includes)
includedir = @includedir@/Mod/Points/App
libdir = $(prefix)/Mod/Points
CLEANFILES = $(BUILT_SOURCES) $(libPoints_la_BUILT)
EXTRA_DIST = \
PointsPy.xml \
CMakeLists.txt

View File

@@ -0,0 +1,298 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 <math.h>
# include <iostream>
#endif
#include <Base/Exception.h>
#include <Base/Matrix.h>
#include <Base/Persistence.h>
#include <Base/Stream.h>
#include <Base/Writer.h>
#include "Points.h"
#include "PointsAlgos.h"
#include "PointsPy.h"
using namespace Points;
using namespace std;
TYPESYSTEM_SOURCE(Points::PointKernel, Data::ComplexGeoData);
std::vector<const char*> PointKernel::getElementTypes(void) const
{
std::vector<const char*> temp;
//temp.push_back("Segment");
return temp;
}
unsigned long PointKernel::countSubElements(const char* Type) const
{
return 0;
}
Data::Segment* PointKernel::getSubElement(const char* Type, unsigned long n) const
{
//unsigned long i = 1;
//if (strcmp(Type,"Segment") == 0) {
// // not implemented
// assert(0);
// return 0;
//}
return 0;
}
void PointKernel::transformGeometry(const Base::Matrix4D &rclMat)
{
std::vector<Base::Vector3f>& kernel = getBasicPoints();
for (std::vector<Base::Vector3f>::iterator it = kernel.begin(); it != kernel.end(); ++it)
*it = rclMat * (*it);
}
Base::BoundBox3d PointKernel::getBoundBox(void)const
{
Base::BoundBox3d bnd;
for (const_point_iterator it = begin(); it != end(); ++it)
bnd.Add(*it);
return bnd;
}
void PointKernel::operator = (const PointKernel& Kernel)
{
if (this != &Kernel) {
// copy the mesh structure
setTransform(Kernel._Mtrx);
this->_Points = Kernel._Points;
}
}
unsigned int PointKernel::getMemSize (void) const
{
return _Points.size() * sizeof(Base::Vector3f);
}
void PointKernel::Save (Base::Writer &writer) const
{
if (!writer.isForceXML()) {
writer.Stream() << writer.ind()
<< "<Points file=\"" << writer.addFile(writer.ObjectName.c_str(), this) << "\" "
<< "mtrx=\"" << _Mtrx.toString() << "\"/>" << std::endl;
}
}
void PointKernel::SaveDocFile (Base::Writer &writer) const
{
Base::OutputStream str(writer.Stream());
uint32_t uCt = (uint32_t)size();
str << uCt;
// store the data without transforming it and save as float, not double
for (std::vector<Base::Vector3f>::const_iterator it = _Points.begin(); it != _Points.end(); ++it) {
str << it->x << it->y << it->z;
}
}
void PointKernel::Restore(Base::XMLReader &reader)
{
clear();
reader.readElement("Points");
std::string file (reader.getAttribute("file") );
if (!file.empty()) {
// initate a file read
reader.addFile(file.c_str(),this);
}
if (reader.DocumentSchema > 3) {
std::string Matrix (reader.getAttribute("mtrx") );
_Mtrx.fromString(Matrix);
}
}
void PointKernel::RestoreDocFile(Base::Reader &reader)
{
Base::InputStream str(reader);
uint32_t uCt = 0;
str >> uCt;
_Points.resize(uCt);
for (unsigned long i=0; i < uCt; i++) {
float x, y, z;
str >> x >> y >> z;
_Points[i].Set(x,y,z);
}
}
void PointKernel::save(const char* file) const
{
//MeshCore::MeshOutput aWriter(_kernel);
//aWriter.SaveAny(file);
}
void PointKernel::load(const char* file)
{
PointsAlgos::Load(*this,file);
}
void PointKernel::save(std::ostream& out) const
{
//kernel.Write(out);
}
void PointKernel::getFaces(std::vector<Base::Vector3d> &Points,std::vector<Facet> &Topo,
float Accuracy, uint16_t flags) const
{
unsigned long ctpoints = _Points.size();
Points.reserve(ctpoints);
for (unsigned long i=0; i<ctpoints; i++) {
Points.push_back(this->getPoint(i));
}
}
// ----------------------------------------------------------------------------
PointKernel::const_point_iterator::const_point_iterator
(const PointKernel* kernel, std::vector<Base::Vector3f>::const_iterator index)
: _kernel(kernel), _p_it(index)
{
if(_p_it != kernel->_Points.end())
{
Base::Vector3d vertd(_p_it->x, _p_it->y, _p_it->z);
this->_point = _kernel->_Mtrx * vertd;
}
}
PointKernel::const_point_iterator::const_point_iterator
(const PointKernel::const_point_iterator& fi)
: _kernel(fi._kernel), _point(fi._point), _p_it(fi._p_it)
{
}
//PointKernel::const_point_iterator::~const_point_iterator()
//{
//}
PointKernel::const_point_iterator&
PointKernel::const_point_iterator::operator=(const PointKernel::const_point_iterator& pi)
{
this->_kernel = pi._kernel;
this->_point = pi._point;
this->_p_it = pi._p_it;
return *this;
}
void PointKernel::const_point_iterator::dereference()
{
Base::Vector3d vertd(_p_it->x, _p_it->y, _p_it->z);
this->_point = _kernel->_Mtrx * vertd;
}
const Base::Vector3d& PointKernel::const_point_iterator::operator*()
{
dereference();
return this->_point;
}
const Base::Vector3d* PointKernel::const_point_iterator::operator->()
{
dereference();
return &(this->_point);
}
bool PointKernel::const_point_iterator::operator==(const PointKernel::const_point_iterator& pi) const
{
return (this->_kernel == pi._kernel) && (this->_p_it == pi._p_it);
}
bool PointKernel::const_point_iterator::operator!=(const PointKernel::const_point_iterator& pi) const
{
return !operator==(pi);
}
PointKernel::const_point_iterator&
PointKernel::const_point_iterator::operator++()
{
++(this->_p_it);
return *this;
}
PointKernel::const_point_iterator
PointKernel::const_point_iterator::operator++(int)
{
PointKernel::const_point_iterator tmp = *this;
++(this->_p_it);
return tmp;
}
PointKernel::const_point_iterator&
PointKernel::const_point_iterator::operator--()
{
--(this->_p_it);
return *this;
}
PointKernel::const_point_iterator
PointKernel::const_point_iterator::operator--(int)
{
PointKernel::const_point_iterator tmp = *this;
--(this->_p_it);
return tmp;
}
PointKernel::const_point_iterator
PointKernel::const_point_iterator::operator+ (difference_type off) const
{
PointKernel::const_point_iterator tmp = *this;
return (tmp+=off);
}
PointKernel::const_point_iterator
PointKernel::const_point_iterator::operator- (difference_type off) const
{
PointKernel::const_point_iterator tmp = *this;
return (tmp-=off);
}
PointKernel::const_point_iterator&
PointKernel::const_point_iterator::operator+=(difference_type off)
{
(this->_p_it) += off;
return *this;
}
PointKernel::const_point_iterator&
PointKernel::const_point_iterator::operator-=(difference_type off)
{
(this->_p_it) -= off;
return *this;
}
PointKernel::difference_type
PointKernel::const_point_iterator::operator- (const PointKernel::const_point_iterator& right) const
{
return this->_p_it - right._p_it;
}

186
src/Mod/Points/App/Points.h Normal file
View File

@@ -0,0 +1,186 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 POINTS_POINT_H
#define POINTS_POINT_H
#include <vector>
#include <iterator>
#include <Base/Vector3D.h>
#include <Base/Matrix.h>
#include <Base/Reader.h>
#include <Base/Writer.h>
#include <App/PropertyStandard.h>
#include <App/PropertyGeo.h>
namespace Points
{
/** Point kernel
*/
class PointsExport PointKernel : public Data::ComplexGeoData
{
TYPESYSTEM_HEADER();
public:
PointKernel(void)
{
}
PointKernel(unsigned long size)
{
resize(size);
}
virtual ~PointKernel()
{
}
void operator = (const PointKernel&);
/** @name Subelement management */
//@{
/** Sub type list
* List of different subelement types
* its NOT a list of the subelements itself
*/
virtual std::vector<const char*> getElementTypes(void) const;
virtual unsigned long countSubElements(const char* Type) const;
/// get the subelement by type and number
virtual Data::Segment* getSubElement(const char* Type, unsigned long) const;
//@}
inline void setTransform(const Base::Matrix4D& rclTrf){_Mtrx = rclTrf;}
inline Base::Matrix4D getTransform(void) const{return _Mtrx;}
std::vector<Base::Vector3f>& getBasicPoints()
{ return this->_Points; }
const std::vector<Base::Vector3f>& getBasicPoints() const
{ return this->_Points; }
void getFaces(std::vector<Base::Vector3d> &Points,std::vector<Facet> &Topo,
float Accuracy, uint16_t flags=0) const;
virtual void transformGeometry(const Base::Matrix4D &rclMat);
virtual Base::BoundBox3d getBoundBox(void)const;
/** @name I/O */
//@{
// Implemented from Persistence
unsigned int getMemSize (void) const;
void Save (Base::Writer &writer) const;
void SaveDocFile (Base::Writer &writer) const;
void Restore(Base::XMLReader &reader);
void RestoreDocFile(Base::Reader &reader);
void save(const char* file) const;
void save(std::ostream&) const;
void load(const char* file);
void load(std::istream&);
//@}
private:
Base::Matrix4D _Mtrx;
std::vector<Base::Vector3f> _Points;
public:
typedef std::vector<Base::Vector3f>::difference_type difference_type;
typedef std::vector<Base::Vector3f>::size_type size_type;
/// number of points stored
size_type size(void) const {return this->_Points.size();}
void resize(unsigned int n){_Points.resize(n);}
void reserve(unsigned int n){_Points.reserve(n);}
inline void erase(unsigned long first, unsigned long last) {
_Points.erase(_Points.begin()+first,_Points.begin()+last);
}
void clear(void){_Points.clear();}
/// get the points
inline const Base::Vector3d getPoint(const int idx) const {
return transformToOutside(_Points[idx]);
}
/// set the points
inline void setPoint(const int idx,const Base::Vector3d& point) {
_Points[idx] = transformToInside(point);
}
/// insert the points
inline void push_back(const Base::Vector3d& point) {
_Points.push_back(transformToInside(point));
}
class PointsExport const_point_iterator
{
public:
typedef std::vector<Base::Vector3f>::const_iterator iter_type;
typedef iter_type::difference_type difference_type;
typedef iter_type::iterator_category iterator_category;
typedef const Base::Vector3d* pointer;
typedef const Base::Vector3d& reference;
typedef Base::Vector3d value_type;
const_point_iterator(const PointKernel*, std::vector<Base::Vector3f>::const_iterator index);
const_point_iterator(const const_point_iterator& pi);
//~const_point_iterator();
const_point_iterator& operator=(const const_point_iterator& fi);
const Base::Vector3d& operator*();
const Base::Vector3d* operator->();
bool operator==(const const_point_iterator& fi) const;
bool operator!=(const const_point_iterator& fi) const;
const_point_iterator& operator++();
const_point_iterator operator++(int);
const_point_iterator& operator--();
const_point_iterator operator--(int);
const_point_iterator operator+ (difference_type off) const;
const_point_iterator operator- (difference_type off) const;
const_point_iterator& operator+=(difference_type off);
const_point_iterator& operator-=(difference_type off);
difference_type operator- (const const_point_iterator& right) const;
private:
void dereference();
const PointKernel* _kernel;
Base::Vector3d _point;
std::vector<Base::Vector3f>::const_iterator _p_it;
};
typedef const_point_iterator const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
/** @name Iterator */
//@{
const_point_iterator begin() const
{ return const_point_iterator(this, _Points.begin()); }
const_point_iterator end() const
{ return const_point_iterator(this, _Points.end()); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end()); }
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin()); }
//@}
};
} // namespace Points
#endif // POINTS_POINTPROPERTIES_H

View File

@@ -0,0 +1,113 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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_
#ifdef FC_OS_LINUX
# include <unistd.h>
#endif
# include <sstream>
#endif
#include "PointsAlgos.h"
#include "Points.h"
#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include <Base/Console.h>
#include <Base/Sequencer.h>
#include <Base/Stream.h>
#include <boost/regex.hpp>
using namespace Points;
void PointsAlgos::Load(PointKernel &points, const char *FileName)
{
Base::FileInfo File(FileName);
// checking on the file
if (!File.isReadable())
throw Base::FileException("File to load not existing or not readable", FileName);
if (File.extension() == "asc" ||File.extension() == "ASC")
LoadAscii(points,FileName);
else
throw Base::Exception("Unknown ending");
}
void PointsAlgos::LoadAscii(PointKernel &points, const char *FileName)
{
boost::regex rx("^\\s*([-+]?[0-9]*)\\.?([0-9]+([eE][-+]?[0-9]+)?)"
"\\s+([-+]?[0-9]*)\\.?([0-9]+([eE][-+]?[0-9]+)?)"
"\\s+([-+]?[0-9]*)\\.?([0-9]+([eE][-+]?[0-9]+)?)\\s*$");
//boost::regex rx("(\\b[0-9]+\\.([0-9]+\\b)?|\\.[0-9]+\\b)");
//boost::regex rx("^\\s*(-?[0-9]*)\\.([0-9]+)\\s+(-?[0-9]*)\\.([0-9]+)\\s+(-?[0-9]*)\\.([0-9]+)\\s*$");
boost::cmatch what;
Base::Vector3d pt;
int LineCnt=0;
std::string line;
Base::FileInfo fi(FileName);
Base::ifstream tmp_str(fi, std::ios::in);
// estimating size
while (std::getline(tmp_str,line))
LineCnt++;
// resize the PointKernel
points.resize(LineCnt);
Base::SequencerLauncher seq( "Loading points...", LineCnt );
// again to the beginning
Base::ifstream file(fi, std::ios::in);
LineCnt = 0;
try {
// read file
while (std::getline(file, line)) {
if (boost::regex_match(line.c_str(), what, rx)) {
pt.x = std::atof(what[1].first);
pt.y = std::atof(what[4].first);
pt.z = std::atof(what[7].first);
points.setPoint(LineCnt,pt);
seq.next();
LineCnt++;
}
}
}
catch (...) {
points.clear();
throw Base::Exception("Reading in points failed.");
}
// now remove the last points from the kernel
// Note: first we allocate memory corresponding to the number of lines (points and comments)
// and read in the file twice. But then the size of the kernel is too high
if (LineCnt < (int)points.size())
points.erase(LineCnt, points.size());
}

View File

@@ -0,0 +1,49 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 _PointsAlgos_h_
#define _PointsAlgos_h_
#include "Points.h"
namespace Points
{
/** The Points algorithems container class
*/
class PointsExport PointsAlgos
{
public:
/** Load a point cloud
*/
static void Load(PointKernel&, const char *FileName);
/** Load a point cloud
*/
static void LoadAscii(PointKernel&, const char *FileName);
};
} // namespace Points
#endif

View File

@@ -0,0 +1,148 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 <vector>
#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/Stream.h>
#include <Base/Writer.h>
#include "PointsFeature.h"
using namespace Points;
//===========================================================================
// Feature
//===========================================================================
PROPERTY_SOURCE(Points::Feature, App::GeoFeature)
Feature::Feature()
{
ADD_PROPERTY(Points, (PointKernel()));
}
Feature::~Feature()
{
}
App::DocumentObjectExecReturn *Feature::execute(void)
{
return App::DocumentObject::StdReturn;
}
void Feature::Restore(Base::XMLReader &reader)
{
GeoFeature::Restore(reader);
}
void Feature::RestoreDocFile(Base::Reader &reader)
{
// This gets only invoked if a points file has been added from Restore()
Points.RestoreDocFile(reader);
}
void Feature::onChanged(const App::Property* prop)
{
// if the placement has changed apply the change to the point data as well
if (prop == &this->Placement) {
PointKernel& pts = const_cast<PointKernel&>(this->Points.getValue());
pts.setTransform(this->Placement.getValue().toMatrix());
}
// if the point data has changed check and adjust the transformation as well
else if (prop == &this->Points) {
Base::Placement p;
p.fromMatrix(this->Points.getValue().getTransform());
if (p != this->Placement.getValue())
this->Placement.setValue(p);
}
GeoFeature::onChanged(prop);
}
// ------------------------------------------------------------------
PROPERTY_SOURCE(Points::Export, Points::Feature)
Export::Export(void)
{
ADD_PROPERTY(Sources ,(0));
ADD_PROPERTY(FileName,(""));
ADD_PROPERTY(Format ,(""));
}
App::DocumentObjectExecReturn *Export::execute(void)
{
// ask for write permission
Base::FileInfo fi(FileName.getValue());
Base::FileInfo di(fi.dirPath().c_str());
if ((fi.exists() && !fi.isWritable()) || !di.exists() || !di.isWritable())
{
return new App::DocumentObjectExecReturn("No write permission for file");
}
Base::ofstream str(fi, std::ios::out | std::ios::binary);
if (fi.hasExtension("asc"))
{
const std::vector<App::DocumentObject*>& features = Sources.getValues();
for ( std::vector<App::DocumentObject*>::const_iterator it = features.begin(); it != features.end(); ++it )
{
Feature *pcFeat = dynamic_cast<Feature*>(*it);
const PointKernel& kernel = pcFeat->Points.getValue();
str << "# " << pcFeat->getNameInDocument() << " Number of points: " << kernel.size() << std::endl;
for ( PointKernel::const_iterator it = kernel.begin(); it != kernel.end(); ++it )
str << it->x << " " << it->y << " " << it->z << std::endl;
}
}
else
{
return new App::DocumentObjectExecReturn("File format not supported");
}
return App::DocumentObject::StdReturn;
}
// ---------------------------------------------------------
namespace App {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(Points::FeaturePython, Points::Feature)
template<> const char* Points::FeaturePython::getViewProviderName(void) const {
return "PointsGui::ViewProviderPython";
}
/// @endcond
// explicit template instantiation
template class PointsExport FeaturePythonT<Points::Feature>;
}

View File

@@ -0,0 +1,105 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 POINTS_FEATURE_H
#define POINTS_FEATURE_H
#include <App/GeoFeature.h>
#include <App/FeaturePython.h>
#include <App/PropertyLinks.h>
#include <App/PropertyGeo.h>
#include "Points.h"
#include "PropertyPointKernel.h"
namespace Base{
class Writer;
}
namespace App{
class Color;
}
namespace Points
{
class Property;
class PointsFeaturePy;
/** Base class of all Points feature classes in FreeCAD.
* This class holds an PointsKernel object.
*/
class PointsExport Feature : public App::GeoFeature
{
PROPERTY_HEADER(Points::Feature);
public:
/// Constructor
Feature(void);
virtual ~Feature(void);
/** @name methods overide Feature */
//@{
void Restore(Base::XMLReader &reader);
void RestoreDocFile(Base::Reader &reader);
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "PointsGui::ViewProviderPoints";
}
protected:
void onChanged(const App::Property* prop);
//@}
public:
PropertyPointKernel Points; /**< The point kernel property. */
};
/**
* The Export class writes a point cloud to a file.
* @author Werner Mayer
*/
class Export : public Feature
{
PROPERTY_HEADER(Points::Export);
public:
Export();
App::PropertyLinkList Sources;
App::PropertyString FileName;
App::PropertyString Format;
/** @name methods override Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
//@}
};
typedef App::FeaturePythonT<Feature> FeaturePython;
} //namespace Points
#endif

View File

@@ -0,0 +1,816 @@
/***************************************************************************
* Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.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 <algorithm>
#endif
#include "PointsGrid.h"
using namespace Points;
PointsGrid::PointsGrid (const PointKernel &rclM)
: _pclPoints(&rclM),
_ulCtElements(0),
_ulCtGridsX(0), _ulCtGridsY(0), _ulCtGridsZ(0),
_fGridLenX(0.0f), _fGridLenY(0.0f), _fGridLenZ(0.0f),
_fMinX(0.0f), _fMinY(0.0f), _fMinZ(0.0f)
{
RebuildGrid();
}
PointsGrid::PointsGrid (void)
: _pclPoints(NULL),
_ulCtElements(0),
_ulCtGridsX(POINTS_CT_GRID), _ulCtGridsY(POINTS_CT_GRID), _ulCtGridsZ(POINTS_CT_GRID),
_fGridLenX(0.0f), _fGridLenY(0.0f), _fGridLenZ(0.0f),
_fMinX(0.0f), _fMinY(0.0f), _fMinZ(0.0f)
{
}
PointsGrid::PointsGrid (const PointKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ)
: _pclPoints(&rclM),
_ulCtElements(0),
_ulCtGridsX(0), _ulCtGridsY(0), _ulCtGridsZ(0),
_fGridLenX(0.0f), _fGridLenY(0.0f), _fGridLenZ(0.0f),
_fMinX(0.0f), _fMinY(0.0f), _fMinZ(0.0f)
{
Rebuild(ulX, ulY, ulZ);
}
PointsGrid::PointsGrid (const PointKernel &rclM, int iCtGridPerAxis)
: _pclPoints(&rclM),
_ulCtElements(0),
_ulCtGridsX(0), _ulCtGridsY(0), _ulCtGridsZ(0),
_fGridLenX(0.0f), _fGridLenY(0.0f), _fGridLenZ(0.0f),
_fMinX(0.0f), _fMinY(0.0f), _fMinZ(0.0f)
{
Rebuild(iCtGridPerAxis);
}
PointsGrid::PointsGrid (const PointKernel &rclM, double fGridLen)
: _pclPoints(&rclM),
_ulCtElements(0),
_ulCtGridsX(0), _ulCtGridsY(0), _ulCtGridsZ(0),
_fGridLenX(0.0f), _fGridLenY(0.0f), _fGridLenZ(0.0f),
_fMinX(0.0f), _fMinY(0.0f), _fMinZ(0.0f)
{
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
clBBPts &= (*it);
Rebuild(std::max<unsigned long>((unsigned long)(clBBPts.LengthX() / fGridLen), 1),
std::max<unsigned long>((unsigned long)(clBBPts.LengthY() / fGridLen), 1),
std::max<unsigned long>((unsigned long)(clBBPts.LengthZ() / fGridLen), 1));
}
void PointsGrid::Attach (const PointKernel &rclM)
{
_pclPoints = &rclM;
RebuildGrid();
}
void PointsGrid::Clear (void)
{
_aulGrid.clear();
_pclPoints = NULL;
}
void PointsGrid::Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ)
{
_ulCtGridsX = ulX;
_ulCtGridsY = ulY;
_ulCtGridsZ = ulZ;
_ulCtElements = HasElements();
RebuildGrid();
}
void PointsGrid::Rebuild (unsigned long ulPerGrid, unsigned long ulMaxGrid)
{
_ulCtElements = HasElements();
CalculateGridLength(ulPerGrid, ulMaxGrid);
RebuildGrid();
}
void PointsGrid::Rebuild (int iCtGridPerAxis)
{
_ulCtElements = HasElements();
CalculateGridLength(iCtGridPerAxis);
RebuildGrid();
}
void PointsGrid::InitGrid (void)
{
assert(_pclPoints != NULL);
unsigned long i, j;
// Grid Laengen berechnen wenn nicht initialisiert
//
if ((_ulCtGridsX == 0) || (_ulCtGridsX == 0) || (_ulCtGridsX == 0))
CalculateGridLength(POINTS_CT_GRID, POINTS_MAX_GRIDS);
// Grid Laengen und Offset bestimmen
//
{
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
clBBPts &= (*it);
double fLengthX = clBBPts.LengthX();
double fLengthY = clBBPts.LengthY();
double fLengthZ = clBBPts.LengthZ();
{
// Offset fGridLen/2
//
_fGridLenX = (1.0f + fLengthX) / double(_ulCtGridsX);
_fMinX = clBBPts.MinX - 0.5f;
}
{
_fGridLenY = (1.0f + fLengthY) / double(_ulCtGridsY);
_fMinY = clBBPts.MinY - 0.5f;
}
{
_fGridLenZ = (1.0f + fLengthZ) / double(_ulCtGridsZ);
_fMinZ = clBBPts.MinZ - 0.5f;
}
}
// Daten-Struktur anlegen
_aulGrid.clear();
_aulGrid.resize(_ulCtGridsX);
for (i = 0; i < _ulCtGridsX; i++)
{
_aulGrid[i].resize(_ulCtGridsY);
for (j = 0; j < _ulCtGridsY; j++)
_aulGrid[i][j].resize(_ulCtGridsZ);
}
}
unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<unsigned long> &raulElements, bool bDelDoubles) const
{
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
raulElements.clear();
// Grid-Boxen zur naehreren Auswahl
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
for (i = ulMinX; i <= ulMaxX; i++)
{
for (j = ulMinY; j <= ulMaxY; j++)
{
for (k = ulMinZ; k <= ulMaxZ; k++)
{
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
}
}
}
if (bDelDoubles == true)
{
// doppelte Nennungen entfernen
std::sort(raulElements.begin(), raulElements.end());
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
}
return raulElements.size();
}
unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::vector<unsigned long> &raulElements, const Base::Vector3d &rclOrg, float fMaxDist, bool bDelDoubles) const
{
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
double fGridDiag = GetBoundBox(0, 0, 0).CalcDiagonalLength();
double fMinDistP2 = (fGridDiag * fGridDiag) + (fMaxDist * fMaxDist);
raulElements.clear();
// Grid-Boxen zur naehreren Auswahl
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
for (i = ulMinX; i <= ulMaxX; i++)
{
for (j = ulMinY; j <= ulMaxY; j++)
{
for (k = ulMinZ; k <= ulMaxZ; k++)
{
if (Base::DistanceP2(GetBoundBox(i, j, k).CalcCenter(), rclOrg) < fMinDistP2)
raulElements.insert(raulElements.end(), _aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
}
}
}
if (bDelDoubles == true)
{
// doppelte Nennungen entfernen
std::sort(raulElements.begin(), raulElements.end());
raulElements.erase(std::unique(raulElements.begin(), raulElements.end()), raulElements.end());
}
return raulElements.size();
}
unsigned long PointsGrid::InSide (const Base::BoundBox3d &rclBB, std::set<unsigned long> &raulElements) const
{
unsigned long i, j, k, ulMinX, ulMinY, ulMinZ, ulMaxX, ulMaxY, ulMaxZ;
raulElements.clear();
// Grid-Boxen zur naehreren Auswahl
Position(Base::Vector3d(rclBB.MinX, rclBB.MinY, rclBB.MinZ), ulMinX, ulMinY, ulMinZ);
Position(Base::Vector3d(rclBB.MaxX, rclBB.MaxY, rclBB.MaxZ), ulMaxX, ulMaxY, ulMaxZ);
for (i = ulMinX; i <= ulMaxX; i++)
{
for (j = ulMinY; j <= ulMaxY; j++)
{
for (k = ulMinZ; k <= ulMaxZ; k++)
{
raulElements.insert(_aulGrid[i][j][k].begin(), _aulGrid[i][j][k].end());
}
}
}
return raulElements.size();
}
void PointsGrid::Position (const Base::Vector3d &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
{
if (rclPoint.x <= _fMinX)
rulX = 0;
else
rulX = std::min<unsigned long>((unsigned long)((rclPoint.x - _fMinX) / _fGridLenX), _ulCtGridsX - 1);
if (rclPoint.y <= _fMinY)
rulY = 0;
else
rulY = std::min<unsigned long>((unsigned long)((rclPoint.y - _fMinY) / _fGridLenY), _ulCtGridsY - 1);
if (rclPoint.z <= _fMinZ)
rulZ = 0;
else
rulZ = std::min<unsigned long>((unsigned long)((rclPoint.z - _fMinZ) / _fGridLenZ), _ulCtGridsZ - 1);
}
void PointsGrid::CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids)
{
// Grid Laengen bzw. Anzahl der Grids pro Dimension berechnen
// pro Grid sollen ca. 10 (?!?!) Facets liegen
// bzw. max Grids sollten 10000 nicht ueberschreiten
Base::BoundBox3d clBBPtsEnlarged;// = _pclPoints->GetBoundBox();
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
clBBPtsEnlarged &= (*it);
double fVolElem;
if (_ulCtElements > (ulMaxGrids * ulCtGrid))
fVolElem = (clBBPtsEnlarged.LengthX() * clBBPtsEnlarged.LengthY() * clBBPtsEnlarged.LengthZ()) / float(ulMaxGrids * ulCtGrid);
else
fVolElem = (clBBPtsEnlarged.LengthX() * clBBPtsEnlarged.LengthY() * clBBPtsEnlarged.LengthZ()) / float(_ulCtElements);
double fVol = fVolElem * float(ulCtGrid);
double fGridLen = float(pow((float)fVol,(float) 1.0f / 3.0f));
_ulCtGridsX = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthX() / fGridLen), 1);
_ulCtGridsY = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthY() / fGridLen), 1);
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(clBBPtsEnlarged.LengthZ() / fGridLen), 1);
}
void PointsGrid::CalculateGridLength (int iCtGridPerAxis)
{
if (iCtGridPerAxis<=0)
{
CalculateGridLength(POINTS_CT_GRID, POINTS_MAX_GRIDS);
return;
}
// Grid Laengen bzw. Anzahl der Grids pro Dimension berechnen
// pro Grid sollen ca. 10 (?!?!) Facets liegen
// bzw. max Grids sollten 10000 nicht ueberschreiten
Base::BoundBox3d clBBPts;// = _pclPoints->GetBoundBox();
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
clBBPts &= (*it);
double fLenghtX = clBBPts.LengthX();
double fLenghtY = clBBPts.LengthY();
double fLenghtZ = clBBPts.LengthZ();
double fLenghtD = clBBPts.CalcDiagonalLength();
double fLengthTol = 0.05f * fLenghtD;
bool bLenghtXisZero = (fLenghtX <= fLengthTol);
bool bLenghtYisZero = (fLenghtY <= fLengthTol);
bool bLenghtZisZero = (fLenghtZ <= fLengthTol);
int iFlag = 0;
int iMaxGrids = 1;
if (bLenghtXisZero)
iFlag += 1;
else
iMaxGrids *= iCtGridPerAxis;
if (bLenghtYisZero)
iFlag += 2;
else
iMaxGrids *= iCtGridPerAxis;
if (bLenghtZisZero)
iFlag += 4;
else
iMaxGrids *= iCtGridPerAxis;
unsigned long ulGridsFacets = 10;
double fFactorVolumen = 40.0;
double fFactorArea = 10.0;
switch (iFlag)
{
case 0:
{
double fVolumen = fLenghtX * fLenghtY * fLenghtZ;
double fVolumenGrid = (fVolumen * ulGridsFacets) / (fFactorVolumen * _ulCtElements);
if ((fVolumenGrid * iMaxGrids) < fVolumen)
fVolumenGrid = fVolumen / (float)iMaxGrids;
double fLengthGrid = float(pow((float)fVolumenGrid,(float) 1.0f / 3.0f));
_ulCtGridsX = std::max<unsigned long>((unsigned long)(fLenghtX / fLengthGrid), 1);
_ulCtGridsY = std::max<unsigned long>((unsigned long)(fLenghtY / fLengthGrid), 1);
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(fLenghtZ / fLengthGrid), 1);
} break;
case 1:
{
_ulCtGridsX = 1; // bLenghtXisZero
double fArea = fLenghtY * fLenghtZ;
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
if ((fAreaGrid * iMaxGrids) < fArea)
fAreaGrid = fArea / (double)iMaxGrids;
double fLengthGrid = double(sqrt(fAreaGrid));
_ulCtGridsY = std::max<unsigned long>((unsigned long)(fLenghtY / fLengthGrid), 1);
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(fLenghtZ / fLengthGrid), 1);
} break;
case 2:
{
_ulCtGridsY = 1; // bLenghtYisZero
double fArea = fLenghtX * fLenghtZ;
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
if ((fAreaGrid * iMaxGrids) < fArea)
fAreaGrid = fArea / (double)iMaxGrids;
double fLengthGrid = double(sqrt(fAreaGrid));
_ulCtGridsX = std::max<unsigned long>((unsigned long)(fLenghtX / fLengthGrid), 1);
_ulCtGridsZ = std::max<unsigned long>((unsigned long)(fLenghtZ / fLengthGrid), 1);
} break;
case 3:
{
_ulCtGridsX = 1; // bLenghtXisZero
_ulCtGridsY = 1; // bLenghtYisZero
_ulCtGridsZ = iMaxGrids; // bLenghtYisZero
} break;
case 4:
{
_ulCtGridsZ = 1; // bLenghtZisZero
double fArea = fLenghtX * fLenghtY;
double fAreaGrid = (fArea * ulGridsFacets) / (fFactorArea * _ulCtElements);
if ((fAreaGrid * iMaxGrids) < fArea)
fAreaGrid = fArea / (float)iMaxGrids;
double fLengthGrid = double(sqrt(fAreaGrid));
_ulCtGridsX = std::max<unsigned long>((unsigned long)(fLenghtX / fLengthGrid), 1);
_ulCtGridsY = std::max<unsigned long>((unsigned long)(fLenghtY / fLengthGrid), 1);
} break;
case 5:
{
_ulCtGridsX = 1; // bLenghtXisZero
_ulCtGridsZ = 1; // bLenghtZisZero
_ulCtGridsY = iMaxGrids; // bLenghtYisZero
} break;
case 6:
{
_ulCtGridsY = 1; // bLenghtYisZero
_ulCtGridsZ = 1; // bLenghtZisZero
_ulCtGridsX = iMaxGrids; // bLenghtYisZero
} break;
case 7:
{
_ulCtGridsX = iMaxGrids; // bLenghtXisZero
_ulCtGridsY = iMaxGrids; // bLenghtYisZero
_ulCtGridsZ = iMaxGrids; // bLenghtZisZero
} break;
}
}
void PointsGrid::SearchNearestFromPoint (const Base::Vector3d &rclPt, std::set<unsigned long> &raclInd) const
{
raclInd.clear();
Base::BoundBox3d clBB = GetBoundBox();
if (clBB.IsInBox(rclPt) == true)
{ // Punkt liegt innerhalb
unsigned long ulX, ulY, ulZ;
Position(rclPt, ulX, ulY, ulZ);
//int nX = ulX, nY = ulY, nZ = ulZ;
unsigned long ulLevel = 0;
while (raclInd.size() == 0)
GetHull(ulX, ulY, ulZ, ulLevel++, raclInd);
GetHull(ulX, ulY, ulZ, ulLevel, raclInd);
}
else
{ // Punkt ausserhalb
Base::BoundBox3d::SIDE tSide = clBB.GetSideFromRay(rclPt, clBB.CalcCenter() - rclPt);
switch (tSide)
{
case Base::BoundBox3d::RIGHT:
{
int nX = 0;
while (raclInd.size() == 0)
{
for (unsigned long i = 0; i < _ulCtGridsY; i++)
{
for (unsigned long j = 0; j < _ulCtGridsZ; j++)
raclInd.insert(_aulGrid[nX][i][j].begin(), _aulGrid[nX][i][j].end());
}
nX++;
}
break;
}
case Base::BoundBox3d::LEFT:
{
int nX = _ulCtGridsX - 1;
while (raclInd.size() == 0)
{
for (unsigned long i = 0; i < _ulCtGridsY; i++)
{
for (unsigned long j = 0; j < _ulCtGridsZ; j++)
raclInd.insert(_aulGrid[nX][i][j].begin(), _aulGrid[nX][i][j].end());
}
nX++;
}
break;
}
case Base::BoundBox3d::TOP:
{
int nY = 0;
while (raclInd.size() == 0)
{
for (unsigned long i = 0; i < _ulCtGridsX; i++)
{
for (unsigned long j = 0; j < _ulCtGridsZ; j++)
raclInd.insert(_aulGrid[i][nY][j].begin(), _aulGrid[i][nY][j].end());
}
nY++;
}
break;
}
case Base::BoundBox3d::BOTTOM:
{
int nY = _ulCtGridsY - 1;
while (raclInd.size() == 0)
{
for (unsigned long i = 0; i < _ulCtGridsX; i++)
{
for (unsigned long j = 0; j < _ulCtGridsZ; j++)
raclInd.insert(_aulGrid[i][nY][j].begin(), _aulGrid[i][nY][j].end());
}
nY--;
}
break;
}
case Base::BoundBox3d::BACK:
{
int nZ = 0;
while (raclInd.size() == 0)
{
for (unsigned long i = 0; i < _ulCtGridsX; i++)
{
for (unsigned long j = 0; j < _ulCtGridsY; j++)
raclInd.insert(_aulGrid[i][j][nZ].begin(), _aulGrid[i][j][nZ].end());
}
nZ++;
}
break;
}
case Base::BoundBox3d::FRONT:
{
int nZ = _ulCtGridsZ - 1;
while (raclInd.size() == 0)
{
for (unsigned long i = 0; i < _ulCtGridsX; i++)
{
for (unsigned long j = 0; j < _ulCtGridsY; j++)
raclInd.insert(_aulGrid[i][j][nZ].begin(), _aulGrid[i][j][nZ].end());
}
nZ--;
}
break;
}
default:
break;
}
}
}
void PointsGrid::GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
unsigned long ulDistance, std::set<unsigned long> &raclInd) const
{
int nX1 = std::max<int>(0, int(ulX) - int(ulDistance));
int nY1 = std::max<int>(0, int(ulY) - int(ulDistance));
int nZ1 = std::max<int>(0, int(ulZ) - int(ulDistance));
int nX2 = std::min<int>(int(_ulCtGridsX) - 1, int(ulX) + int(ulDistance));
int nY2 = std::min<int>(int(_ulCtGridsY) - 1, int(ulY) + int(ulDistance));
int nZ2 = std::min<int>(int(_ulCtGridsZ) - 1, int(ulZ) + int(ulDistance));
int i, j;
// top plane
for (i = nX1; i <= nX2; i++)
{
for (j = nY1; j <= nY2; j++)
GetElements(i, j, nZ1, raclInd);
}
// bottom plane
for (i = nX1; i <= nX2; i++)
{
for (j = nY1; j <= nY2; j++)
GetElements(i, j, nZ2, raclInd);
}
// left plane
for (i = nY1; i <= nY2; i++)
{
for (j = (nZ1+1); j <= (nZ2-1); j++)
GetElements(nX1, i, j, raclInd);
}
// right plane
for (i = nY1; i <= nY2; i++)
{
for (j = (nZ1+1); j <= (nZ2-1); j++)
GetElements(nX2, i, j, raclInd);
}
// front plane
for (i = (nX1+1); i <= (nX2-1); i++)
{
for (j = (nZ1+1); j <= (nZ2-1); j++)
GetElements(i, nY1, j, raclInd);
}
// back plane
for (i = (nX1+1); i <= (nX2-1); i++)
{
for (j = (nZ1+1); j <= (nZ2-1); j++)
GetElements(i, nY2, j, raclInd);
}
}
unsigned long PointsGrid::GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ,
std::set<unsigned long> &raclInd) const
{
const std::set<unsigned long> &rclSet = _aulGrid[ulX][ulY][ulZ];
if (rclSet.size() > 0)
{
raclInd.insert(rclSet.begin(), rclSet.end());
return rclSet.size();
}
return 0;
}
void PointsGrid::AddPoint (const Base::Vector3d &rclPt, unsigned long ulPtIndex, float fEpsilon)
{
unsigned long ulX, ulY, ulZ;
Pos(Base::Vector3d(rclPt.x, rclPt.y, rclPt.z), ulX, ulY, ulZ);
if ( (ulX < _ulCtGridsX) && (ulY < _ulCtGridsY) && (ulZ < _ulCtGridsZ) )
_aulGrid[ulX][ulY][ulZ].insert(ulPtIndex);
}
void PointsGrid::Validate (const PointKernel &rclPoints)
{
if (_pclPoints != &rclPoints)
Attach(rclPoints);
else if (rclPoints.size() != _ulCtElements)
RebuildGrid();
}
void PointsGrid::Validate (void)
{
if (_pclPoints == NULL)
return;
if (_pclPoints->size() != _ulCtElements)
RebuildGrid();
}
bool PointsGrid::Verify() const
{
if ( !_pclPoints )
return false; // no point cloud attached
if (_pclPoints->size() != _ulCtElements)
return false; // not up-to-date
PointsGridIterator it(*this);
for ( it.Init(); it.More(); it.Next() )
{
std::vector<unsigned long> aulElements;
it.GetElements( aulElements );
for ( std::vector<unsigned long>::iterator itP = aulElements.begin(); itP != aulElements.end(); ++itP )
{
const Base::Vector3d& cP = _pclPoints->getPoint(*itP);
if ( it.GetBoundBox().IsInBox( cP ) == false )
return false; // point doesn't lie inside the grid element
}
}
return true;
}
void PointsGrid::RebuildGrid (void)
{
_ulCtElements = _pclPoints->size();
InitGrid();
// Daten-Struktur fuellen
unsigned long i = 0;
for (PointKernel::const_iterator it = _pclPoints->begin(); it != _pclPoints->end(); ++it )
{
AddPoint(*it, i++);
}
}
void PointsGrid::Pos (const Base::Vector3d &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
{
rulX = (unsigned long)((rclPoint.x - _fMinX) / _fGridLenX);
rulY = (unsigned long)((rclPoint.y - _fMinY) / _fGridLenY);
rulZ = (unsigned long)((rclPoint.z - _fMinZ) / _fGridLenZ);
}
unsigned long PointsGrid::FindElements (const Base::Vector3d &rclPoint, std::set<unsigned long>& aulElements) const
{
unsigned long ulX, ulY, ulZ;
Pos(rclPoint, ulX, ulY, ulZ);
// check if the given point is inside the grid structure
if ( (ulX < _ulCtGridsX) && (ulY < _ulCtGridsY) && (ulZ < _ulCtGridsZ) )
{
return GetElements(ulX, ulY, ulZ, aulElements);
}
return 0;
}
// ----------------------------------------------------------------
PointsGridIterator::PointsGridIterator (const PointsGrid &rclG)
: _rclGrid(rclG),
_ulX(0), _ulY(0), _ulZ(0),
_clPt(0.0f, 0.0f, 0.0f), _clDir(0.0f, 0.0f, 0.0f),
_bValidRay(false),
_fMaxSearchArea (FLOAT_MAX)
{
}
bool PointsGridIterator::InitOnRay (const Base::Vector3d &rclPt, const Base::Vector3d &rclDir, float fMaxSearchArea,
std::vector<unsigned long> &raulElements)
{
bool ret = InitOnRay (rclPt, rclDir, raulElements);
_fMaxSearchArea = fMaxSearchArea;
return ret;
}
bool PointsGridIterator::InitOnRay (const Base::Vector3d &rclPt, const Base::Vector3d &rclDir,
std::vector<unsigned long> &raulElements)
{
// needed in NextOnRay() to avoid an infinite loop
_cSearchPositions.clear();
_fMaxSearchArea = FLOAT_MAX;
raulElements.clear();
_clPt = rclPt;
_clDir = rclDir;
_bValidRay = false;
// liegt Punkt innerhalb globalen BB
if ((_rclGrid.GetBoundBox().IsInBox(rclPt)) == true)
{ // Voxel bestimmen, indem der Startpunkt liegt
_rclGrid.Position(rclPt, _ulX, _ulY, _ulZ);
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
_bValidRay = true;
}
else
{ // Startpunkt ausserhalb
Base::Vector3d cP0, cP1;
if (_rclGrid.GetBoundBox().IntersectWithLine(rclPt, rclDir, cP0, cP1) == true)
{ // naechsten Punkt bestimmen
if ((cP0 - rclPt).Length() < (cP1 - rclPt).Length())
_rclGrid.Position(cP0, _ulX, _ulY, _ulZ);
else
_rclGrid.Position(cP1, _ulX, _ulY, _ulZ);
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
_bValidRay = true;
}
}
return _bValidRay;
}
bool PointsGridIterator::NextOnRay (std::vector<unsigned long> &raulElements)
{
if (_bValidRay == false)
return false; // nicht initialisiert oder Strahl ausgetreten
raulElements.clear();
Base::Vector3d clIntersectPoint;
// naechstes anliegende BB auf dem Suchstrahl suchen
Base::BoundBox3d::SIDE tSide = _rclGrid.GetBoundBox(_ulX, _ulY, _ulZ).GetSideFromRay(_clPt, _clDir, clIntersectPoint);
// Suchbereich
//
if ((_clPt-clIntersectPoint).Length() > _fMaxSearchArea)
{
_bValidRay = false;
}
else
{
switch (tSide)
{
case Base::BoundBox3d::LEFT: _ulX--; break;
case Base::BoundBox3d::RIGHT: _ulX++; break;
case Base::BoundBox3d::BOTTOM: _ulY--; break;
case Base::BoundBox3d::TOP: _ulY++; break;
case Base::BoundBox3d::FRONT: _ulZ--; break;
case Base::BoundBox3d::BACK: _ulZ++; break;
default:
case Base::BoundBox3d::INVALID:
_bValidRay = false;
break;
}
GridElement pos(_ulX, _ulY, _ulZ);
if ( _cSearchPositions.find( pos ) != _cSearchPositions.end() )
_bValidRay = false; // grid element already visited => result from GetSideFromRay invalid
}
if ((_bValidRay == true) && (_rclGrid.CheckPos(_ulX, _ulY, _ulZ) == true))
{
GridElement pos(_ulX, _ulY, _ulZ); _cSearchPositions.insert(pos);
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
}
else
_bValidRay = false; // Strahl ausgetreten
return _bValidRay;
}

View File

@@ -0,0 +1,272 @@
/***************************************************************************
* Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.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 POINTS_GRID_H
#define POINTS_GRID_H
#include <set>
#include "Points.h"
#include <Base/Vector3D.h>
#include <Base/BoundBox.h>
#define POINTS_CT_GRID 256 // Default value for number of elements per grid
#define POINTS_MAX_GRIDS 100000 // Default value for maximum number of grids
#define POINTS_CT_GRID_PER_AXIS 20
#define PONTSGRID_BBOX_EXTENSION 10.0f
namespace Points {
class PointsGrid;
/**
* The PointsGrid allows to divide a global point cloud into smaller regions of elements depending on the resolution of the grid.
* All grid elements in the grid structure have the same size.
*
* Grids can be used within algorithms to avoid to iterate through all elements, so grids can speed up algorithms dramatically.
* @author Werner Mayer
*/
class PointsExport PointsGrid
{
public:
/** @name Construction */
//@{
/// Construction
PointsGrid (const PointKernel &rclM);
/// Construction
PointsGrid (void);
/// Construction
PointsGrid (const PointKernel &rclM, int iCtGridPerAxis);
/// Construction
PointsGrid (const PointKernel &rclM, double fGridLen);
/// Construction
PointsGrid (const PointKernel &rclM, unsigned long ulX, unsigned long ulY, unsigned long ulZ);
/// Destruction
virtual ~PointsGrid (void) { }
//@}
public:
/** Attaches the point kernel to this grid, an already attached point cloud gets detached. The grid gets rebuilt
* automatically. */
virtual void Attach (const PointKernel &rclM);
/** Rebuilds the grid structure. */
virtual void Rebuild (unsigned long ulPerGrid = POINTS_CT_GRID, unsigned long ulMaxGrid = POINTS_MAX_GRIDS);
/** Rebuilds the grid structure. */
virtual void Rebuild (int iCtGridPerAxis = POINTS_CT_GRID_PER_AXIS);
/** Rebuilds the grid structure. */
virtual void Rebuild (unsigned long ulX, unsigned long ulY, unsigned long ulZ);
/** @name Search */
//@{
/** Searches for elements lying in the intersection area of the grid and the bounding box. */
virtual unsigned long InSide (const Base::BoundBox3d &rclBB, std::vector<unsigned long> &raulElements, bool bDelDoubles = true) const;
/** Searches for elements lying in the intersection area of the grid and the bounding box. */
virtual unsigned long InSide (const Base::BoundBox3d &rclBB, std::set<unsigned long> &raulElementss) const;
/** Searches for elements lying in the intersection area of the grid and the bounding box. */
virtual unsigned long InSide (const Base::BoundBox3d &rclBB, std::vector<unsigned long> &raulElements,
const Base::Vector3d &rclOrg, float fMaxDist, bool bDelDoubles = true) const;
/** Searches for the nearest grids that contain elements from a point, the result are grid indices. */
void SearchNearestFromPoint (const Base::Vector3d &rclPt, std::set<unsigned long> &rclInd) const;
//@}
/** Returns the lengths of the grid elements in x,y and z direction. */
virtual void GetGridLengths (double &rfLenX, double &rfLenY, double &rfLenZ) const
{ rfLenX = _fGridLenX; rfLenY = _fGridLenY; rfLenZ = _fGridLenZ; }
/** Returns the number of grid elements in x,y and z direction. */
virtual void GetCtGrids (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
{ rulX = _ulCtGridsX; rulY = _ulCtGridsY; rulZ = _ulCtGridsZ; }
/** @name Boundings */
//@{
/** Returns the bounding box of a given grid element. */
inline Base::BoundBox3d GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const;
/** Returns the bounding box of the whole. */
inline Base::BoundBox3d GetBoundBox (void) const;
//@}
/** Returns the number of elements in a given grid. */
unsigned long GetCtElements(unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
{ return _aulGrid[ulX][ulY][ulZ].size(); }
/** Finds all points that lie in the same grid as the point \a rclPoint. */
unsigned long FindElements(const Base::Vector3d &rclPoint, std::set<unsigned long>& aulElements) const;
/** Validates the grid structure and rebuilds it if needed. */
virtual void Validate (const PointKernel &rclM);
/** Validates the grid structure and rebuilds it if needed. */
virtual void Validate (void);
/** Verifies the grid structure and returns false if inconsistencies are found. */
virtual bool Verify() const;
/** Returns the indices of the grid this point lies in. If the point is outside the grid then the indices of
* the nearest grid element are taken.*/
virtual void Position (const Base::Vector3d &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const;
/** Returns the indices of the elements in the given grid. */
unsigned long GetElements (unsigned long ulX, unsigned long ulY, unsigned long ulZ, std::set<unsigned long> &raclInd) const;
protected:
/** Checks if this is a valid grid position. */
inline bool CheckPos (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const;
/** Initializes the size of the internal structure. */
virtual void InitGrid (void);
/** Deletes the grid structure. */
virtual void Clear (void);
/** Calculates the grid length dependent on maximum number of grids. */
virtual void CalculateGridLength (unsigned long ulCtGrid, unsigned long ulMaxGrids);
/** Calculates the grid length dependent on the number of grids per axis. */
virtual void CalculateGridLength (int iCtGridPerAxis);
/** Rebuilds the grid structure. */
virtual void RebuildGrid (void);
/** Returns the number of stored elements. */
unsigned long HasElements (void) const
{ return _pclPoints->size(); }
/** Get the indices of all elements lying in the grids around a given grid with distance \a ulDistance. */
void GetHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, std::set<unsigned long> &raclInd) const;
protected:
std::vector<std::vector<std::vector<std::set<unsigned long> > > > _aulGrid; /**< Grid data structure. */
const PointKernel* _pclPoints; /**< The point kernel. */
unsigned long _ulCtElements;/**< Number of grid elements for validation issues. */
unsigned long _ulCtGridsX; /**< Number of grid elements in z. */
unsigned long _ulCtGridsY; /**< Number of grid elements in z. */
unsigned long _ulCtGridsZ; /**< Number of grid elements in z. */
double _fGridLenX; /**< Length of grid elements in x. */
double _fGridLenY; /**< Length of grid elements in y. */
double _fGridLenZ; /**< Length of grid elements in z. */
double _fMinX; /**< Grid null position in x. */
double _fMinY; /**< Grid null position in y. */
double _fMinZ; /**< Grid null position in z. */
// friends
friend class PointsGridIterator;
friend class PointsGridIteratorStatistic;
public:
protected:
/** Adds a new point element to the grid structure. \a rclPt is the geometric point and \a ulPtIndex
* the corresponding index in the point kernel. */
void AddPoint (const Base::Vector3d &rclPt, unsigned long ulPtIndex, float fEpsilon = 0.0f);
/** Returns the grid numbers to the given point \a rclPoint. */
void Pos(const Base::Vector3d &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const;
};
/**
* The PointsGridIterator class provides an interface to walk through
* all grid elements of a point grid.
*/
class PointsExport PointsGridIterator
{
public:
/// Construction
PointsGridIterator (const PointsGrid &rclG);
/** Returns the bounding box of the current grid element. */
Base::BoundBox3d GetBoundBox (void) const
{ return _rclGrid.GetBoundBox(_ulX, _ulY, _ulZ); }
/** Returns indices of the elements in the current grid. */
void GetElements (std::vector<unsigned long> &raulElements) const
{
raulElements.insert(raulElements.end(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].begin(), _rclGrid._aulGrid[_ulX][_ulY][_ulZ].end());
}
/** @name Iteration */
//@{
/** Sets the iterator to the first element*/
void Init (void)
{ _ulX = _ulY = _ulZ = 0; }
/** Checks if the iterator has not yet reached the end position. */
bool More (void) const
{ return (_ulZ < _rclGrid._ulCtGridsZ); }
/** Go to the next grid. */
void Next (void)
{
if (++_ulX >= (_rclGrid._ulCtGridsX)) _ulX = 0; else return;
if (++_ulY >= (_rclGrid._ulCtGridsY)) { _ulY = 0; _ulZ++; } else return;
}
//@}
/** @name Tests with rays */
//@{
/** Searches for facets around the ray. */
bool InitOnRay (const Base::Vector3d &rclPt, const Base::Vector3d &rclDir, std::vector<unsigned long> &raulElements);
/** Searches for facets around the ray. */
bool InitOnRay (const Base::Vector3d &rclPt, const Base::Vector3d &rclDir, float fMaxSearchArea, std::vector<unsigned long> &raulElements);
/** Searches for facets around the ray. */
bool NextOnRay (std::vector<unsigned long> &raulElements);
//@}
/** Returns the grid number of the current position. */
void GetGridPos (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const
{ rulX = _ulX; rulY = _ulY; rulZ = _ulZ; }
protected:
const PointsGrid& _rclGrid; /**< The point grid. */
unsigned long _ulX; /**< Number of grids in x. */
unsigned long _ulY; /**< Number of grids in y. */
unsigned long _ulZ; /**< Number of grids in z. */
Base::Vector3d _clPt; /**< Base point of search ray. */
Base::Vector3d _clDir; /**< Direction of search ray. */
bool _bValidRay; /**< Search ray ok? */
float _fMaxSearchArea;
/** Checks if a grid position is already visited by NextOnRay(). */
struct GridElement
{
GridElement( unsigned long x, unsigned long y, unsigned long z)
{ this->x = x; this->y = y; this->z = z; }
bool operator < (const GridElement& pos) const
{
if ( x == pos.x)
{ if ( y == pos.y) return z < pos.z; else return y < pos.y; }
else
{ return x < pos.x; }
}
private:
unsigned long x,y,z;
};
std::set<GridElement> _cSearchPositions;
};
// --------------------------------------------------------------
inline Base::BoundBox3d PointsGrid::GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
{
double fX, fY, fZ;
fX = _fMinX + (double(ulX) * _fGridLenX);
fY = _fMinY + (double(ulY) * _fGridLenY);
fZ = _fMinZ + (double(ulZ) * _fGridLenZ);
return Base::BoundBox3d(fX, fY, fZ, fX + _fGridLenX, fY + _fGridLenY, fZ + _fGridLenZ);
}
inline Base::BoundBox3d PointsGrid::GetBoundBox (void) const
{
return Base::BoundBox3d(_fMinX, _fMinY, _fMinZ, _fMinX + (_fGridLenX * double(_ulCtGridsX)),
_fMinY + (_fGridLenY * double(_ulCtGridsY)), _fMinZ + (_fGridLenZ * double(_ulCtGridsZ)));
}
inline bool PointsGrid::CheckPos (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const
{
return ((ulX < _ulCtGridsX) && (ulY < _ulCtGridsY) && (ulZ < _ulCtGridsZ));
}
// --------------------------------------------------------------
} // namespace Points
#endif // POINTS_GRID_H

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
<PythonExport
Father="ComplexGeoDataPy"
Include="Mod/Points/App/Points.h"
Name="PointsPy"
Twin="PointKernel"
TwinPointer="PointKernel"
Namespace="Points"
FatherInclude="App/ComplexGeoDataPy.h"
FatherNamespace="Data"
Constructor="true">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="Juergen.Riegel@web.de" />
<UserDocu>Points() -- Create an empty points object.
This class allows one to manipulate the Points object by adding new points, deleting facets, importing from an STL file,
transforming and much more.
</UserDocu>
</Documentation>
<Methode Name="copy" Const="true">
<Documentation>
<UserDocu>Create a copy of this points object</UserDocu>
</Documentation>
</Methode>
<Methode Name="read">
<Documentation>
<UserDocu>Read in a points object from file.</UserDocu>
</Documentation>
</Methode>
<Methode Name="write" Const="true">
<Documentation>
<UserDocu>Write the points object into file.</UserDocu>
</Documentation>
</Methode>
<Methode Name="writeInventor" Const="true">
<Documentation>
<UserDocu>Write the points in OpenInventor format to a string.</UserDocu>
</Documentation>
</Methode>
<Methode Name="addPoints" >
<Documentation>
<UserDocu>add one or more (list of) points to the object</UserDocu>
</Documentation>
</Methode>
<Attribute Name="CountPoints" ReadOnly="true">
<Documentation>
<UserDocu>Return the number of vertices of the points object.</UserDocu>
</Documentation>
<Parameter Name="CountPoints" Type="Int" />
</Attribute>
<Attribute Name="Points" ReadOnly="true">
<Documentation>
<UserDocu>A collection of points
With this attribute it is possible to get access to the points of the object
for p in pnt.Points:
print p
</UserDocu>
</Documentation>
<Parameter Name="Points" Type="List" />
</Attribute>
<ClassDeclarations>
</ClassDeclarations>
</PythonExport>
</GenerateModel>

View File

@@ -0,0 +1,189 @@
/***************************************************************************
* Copyright (c) 2008 Juergen Riegel <juergen.riegel@web.de> *
* *
* 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"
#include "Mod/Points/App/Points.h"
#include <Base/Builder3D.h>
#include <Base/VectorPy.h>
#include <Base/GeometryPyCXX.h>
// inclusion of the generated files (generated out of PointsPy.xml)
#include "PointsPy.h"
#include "PointsPy.cpp"
using namespace Points;
// returns a string which represents the object e.g. when printed in python
std::string PointsPy::representation(void) const
{
return std::string("<PointKernel object>");
}
PyObject *PointsPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
{
// create a new instance of PointsPy and the Twin object
return new PointsPy(new PointKernel);
}
// constructor method
int PointsPy::PyInit(PyObject* args, PyObject* /*kwd*/)
{
PyObject *pcObj=0;
if (!PyArg_ParseTuple(args, "|O", &pcObj)) // convert args: Python->C
return -1; // NULL triggers exception
// if no mesh is given
if (!pcObj) return 0;
if (PyObject_TypeCheck(pcObj, &(PointsPy::Type))) {
*getPointKernelPtr() = *(static_cast<PointsPy*>(pcObj)->getPointKernelPtr());
}
else if (PyList_Check(pcObj)) {
addPoints(args);
}
else if (PyTuple_Check(pcObj)) {
addPoints(args);
}
else if (PyString_Check(pcObj)) {
getPointKernelPtr()->load(PyString_AsString(pcObj));
}
return 0;
}
PyObject* PointsPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
PointKernel* kernel = new PointKernel();
// assign data
*kernel = *getPointKernelPtr();
return new PointsPy(kernel);
}
PyObject* PointsPy::read(PyObject * args)
{
const char* Name;
if (!PyArg_ParseTuple(args, "s",&Name))
return NULL;
PY_TRY {
getPointKernelPtr()->load(Name);
} PY_CATCH;
Py_Return;
}
PyObject* PointsPy::write(PyObject * args)
{
const char* Name;
if (!PyArg_ParseTuple(args, "s",&Name))
return NULL;
PY_TRY {
getPointKernelPtr()->save(Name);
} PY_CATCH;
Py_Return;
}
PyObject* PointsPy::writeInventor(PyObject * args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
std::stringstream result;
Base::InventorBuilder builder(result);
builder.beginPoints();
PointKernel* kernel = getPointKernelPtr();
for (Points::PointKernel::const_iterator it = kernel->begin(); it != kernel->end(); ++it)
builder.addPoint((float)it->x,(float)it->y,(float)it->z);
builder.endPoints();
builder.close();
return Py::new_reference_to(Py::String(result.str()));
}
PyObject* PointsPy::addPoints(PyObject * args)
{
PyObject *obj;
if (!PyArg_ParseTuple(args, "O!", &PyList_Type, &obj))
return 0;
Py::List list(obj);
union PyType_Object pyType = {&(Base::VectorPy::Type)};
Py::Type vType(pyType.o);
try {
for (Py::List::iterator it = list.begin(); it != list.end(); ++it) {
if ((*it).isType(vType)) {
Py::Vector p(*it);
getPointKernelPtr()->push_back(p.toVector());
}
else {
Base::Vector3d pnt;
Py::Tuple tuple(*it);
pnt.x = (double)Py::Float(tuple[0]);
pnt.y = (double)Py::Float(tuple[1]);
pnt.z = (double)Py::Float(tuple[2]);
getPointKernelPtr()->push_back(pnt);
}
}
}
catch (const Py::Exception&) {
PyErr_SetString(PyExc_Exception, "either expect\n"
"-- [Vector,...] \n"
"-- [(x,y,z),...]");
return 0;
}
Py_Return;
}
Py::Int PointsPy::getCountPoints(void) const
{
return Py::Int((long)getPointKernelPtr()->size());
}
Py::List PointsPy::getPoints(void) const
{
Py::List PointList;
const PointKernel* points = getPointKernelPtr();
for (PointKernel::const_point_iterator it = points->begin(); it != points->end(); ++it) {
PointList.append(Py::Object(new Base::VectorPy(*it)));
}
return PointList;
}
PyObject *PointsPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
}
int PointsPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
}

View File

@@ -0,0 +1,24 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
* *
* 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"

View File

@@ -0,0 +1,70 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
* *
* 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 POINTS_PRECOMPILED_H
#define POINTS_PRECOMPILED_H
#include <FCConfig.h>
// Exporting of App classes
#ifdef FC_OS_WIN32
# define PointsExport __declspec(dllexport)
#else // for Linux
# define PointsExport
#endif
#ifdef _PreComp_
// here get the warnings of too long specifiers disabled (needed for VC6)
#ifdef _MSC_VER
# pragma warning( disable : 4251 )
# pragma warning( disable : 4503 )
# pragma warning( disable : 4275 )
# pragma warning( disable : 4786 ) // specifier longer then 255 chars
#endif
// standard
#include <stdio.h>
#include <assert.h>
// STL
#include <algorithm>
#include <iostream>
#include <fstream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <bitset>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#endif //_PreComp_
#endif

View File

@@ -0,0 +1,325 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 <cmath>
# include <iostream>
# include <algorithm>
#endif
#include <Base/Exception.h>
#include <Base/Matrix.h>
#include <Base/Persistence.h>
#include <Base/Stream.h>
#include <Base/Writer.h>
#include "Points.h"
#include "Properties.h"
#include "PointsPy.h"
using namespace Points;
using namespace std;
TYPESYSTEM_SOURCE(Points::PropertyGreyValue, App::PropertyFloat);
TYPESYSTEM_SOURCE(Points::PropertyGreyValueList, App::PropertyFloatList);
TYPESYSTEM_SOURCE(Points::PropertyNormalList, App::PropertyVectorList);
TYPESYSTEM_SOURCE(Points::PropertyCurvatureList , App::PropertyLists);
void PropertyGreyValueList::removeIndices( const std::vector<unsigned long>& uIndices )
{
// We need a sorted array
std::vector<unsigned long> uSortedInds = uIndices;
std::sort(uSortedInds.begin(), uSortedInds.end());
const std::vector<float>& rValueList = getValues();
assert( uSortedInds.size() <= rValueList.size() );
if ( uSortedInds.size() > rValueList.size() )
return;
std::vector<float> remainValue;
remainValue.reserve(rValueList.size() - uSortedInds.size());
std::vector<unsigned long>::iterator pos = uSortedInds.begin();
for ( std::vector<float>::const_iterator it = rValueList.begin(); it != rValueList.end(); ++it ) {
unsigned long index = it - rValueList.begin();
if (pos == uSortedInds.end())
remainValue.push_back( *it );
else if (index != *pos)
remainValue.push_back( *it );
else
pos++;
}
setValues(remainValue);
}
void PropertyNormalList::transform(const Base::Matrix4D &mat)
{
// A normal vector is only a direction with unit length, so we only need to rotate it
// (no translations or scaling)
// Extract scale factors (assumes an orthogonal rotation matrix)
// Use the fact that the length of the row vectors of R are all equal to 1
// And that scaling is applied after rotating
double s[3];
s[0] = sqrt(mat[0][0] * mat[0][0] + mat[0][1] * mat[0][1] + mat[0][2] * mat[0][2]);
s[1] = sqrt(mat[1][0] * mat[1][0] + mat[1][1] * mat[1][1] + mat[1][2] * mat[1][2]);
s[2] = sqrt(mat[2][0] * mat[2][0] + mat[2][1] * mat[2][1] + mat[2][2] * mat[2][2]);
// Set up the rotation matrix: zero the translations and make the scale factors = 1
Base::Matrix4D rot;
rot.setToUnity();
for (unsigned short i = 0; i < 3; i++) {
for (unsigned short j = 0; j < 3; j++) {
rot[i][j] = mat[i][j] / s[i];
}
}
// Rotate the normal vectors
for (int ii=0; ii<getSize(); ii++) {
set1Value(ii, rot * operator[](ii));
}
}
void PropertyNormalList::removeIndices( const std::vector<unsigned long>& uIndices )
{
// We need a sorted array
std::vector<unsigned long> uSortedInds = uIndices;
std::sort(uSortedInds.begin(), uSortedInds.end());
const std::vector<Base::Vector3f>& rValueList = getValues();
assert( uSortedInds.size() <= rValueList.size() );
if ( uSortedInds.size() > rValueList.size() )
return;
std::vector<Base::Vector3f> remainValue;
remainValue.reserve(rValueList.size() - uSortedInds.size());
std::vector<unsigned long>::iterator pos = uSortedInds.begin();
for ( std::vector<Base::Vector3f>::const_iterator it = rValueList.begin(); it != rValueList.end(); ++it ) {
unsigned long index = it - rValueList.begin();
if (pos == uSortedInds.end())
remainValue.push_back( *it );
else if (index != *pos)
remainValue.push_back( *it );
else
pos++;
}
setValues(remainValue);
}
PropertyCurvatureList::PropertyCurvatureList()
{
}
PropertyCurvatureList::~PropertyCurvatureList()
{
}
void PropertyCurvatureList::setValue(const CurvatureInfo& lValue)
{
aboutToSetValue();
_lValueList.resize(1);
_lValueList[0]=lValue;
hasSetValue();
}
void PropertyCurvatureList::setValues(const std::vector<CurvatureInfo>& lValues)
{
aboutToSetValue();
_lValueList=lValues;
hasSetValue();
}
std::vector<float> PropertyCurvatureList::getCurvature( int mode ) const
{
const std::vector<Points::CurvatureInfo>& fCurvInfo = getValues();
std::vector<float> fValues;
fValues.reserve(fCurvInfo.size());
// Mean curvature
if (mode == MeanCurvature) {
for (std::vector<Points::CurvatureInfo>::const_iterator it=fCurvInfo.begin();it!=fCurvInfo.end(); ++it) {
fValues.push_back( 0.5f*(it->fMaxCurvature+it->fMinCurvature) );
}
}
// Gaussian curvature
else if (mode == GaussCurvature) {
for (std::vector<Points::CurvatureInfo>::const_iterator it=fCurvInfo.begin();it!=fCurvInfo.end(); ++it) {
fValues.push_back( it->fMaxCurvature * it->fMinCurvature );
}
}
// Maximum curvature
else if (mode == MaxCurvature) {
for (std::vector<Points::CurvatureInfo>::const_iterator it=fCurvInfo.begin();it!=fCurvInfo.end(); ++it) {
fValues.push_back( it->fMaxCurvature );
}
}
// Minimum curvature
else if (mode == MinCurvature) {
for (std::vector<Points::CurvatureInfo>::const_iterator it=fCurvInfo.begin();it!=fCurvInfo.end(); ++it) {
fValues.push_back( it->fMinCurvature );
}
}
// Absolute curvature
else if (mode == AbsCurvature) {
for (std::vector<Points::CurvatureInfo>::const_iterator it=fCurvInfo.begin();it!=fCurvInfo.end(); ++it) {
if (fabs(it->fMaxCurvature) > fabs(it->fMinCurvature))
fValues.push_back( it->fMaxCurvature );
else
fValues.push_back( it->fMinCurvature );
}
}
return fValues;
}
void PropertyCurvatureList::transform(const Base::Matrix4D &mat)
{
// The principal direction is only a vector with unit length, so we only need to rotate it
// (no translations or scaling)
// Extract scale factors (assumes an orthogonal rotation matrix)
// Use the fact that the length of the row vectors of R are all equal to 1
// And that scaling is applied after rotating
double s[3];
s[0] = sqrt(mat[0][0] * mat[0][0] + mat[0][1] * mat[0][1] + mat[0][2] * mat[0][2]);
s[1] = sqrt(mat[1][0] * mat[1][0] + mat[1][1] * mat[1][1] + mat[1][2] * mat[1][2]);
s[2] = sqrt(mat[2][0] * mat[2][0] + mat[2][1] * mat[2][1] + mat[2][2] * mat[2][2]);
// Set up the rotation matrix: zero the translations and make the scale factors = 1
Base::Matrix4D rot;
rot.setToUnity();
for (unsigned short i = 0; i < 3; i++) {
for (unsigned short j = 0; j < 3; j++) {
rot[i][j] = mat[i][j] / s[i];
}
}
// Rotate the principal directions
for (int ii=0; ii<getSize(); ii++) {
CurvatureInfo ci = operator[](ii);
ci.cMaxCurvDir = rot * ci.cMaxCurvDir;
ci.cMinCurvDir = rot * ci.cMinCurvDir;
set1Value(ii, ci);
}
}
void PropertyCurvatureList::removeIndices( const std::vector<unsigned long>& uIndices )
{
// We need a sorted array
std::vector<unsigned long> uSortedInds = uIndices;
std::sort(uSortedInds.begin(), uSortedInds.end());
assert( uSortedInds.size() <= _lValueList.size() );
if ( uSortedInds.size() > _lValueList.size() )
return;
std::vector<CurvatureInfo> remainValue;
remainValue.reserve(_lValueList.size() - uSortedInds.size());
std::vector<unsigned long>::iterator pos = uSortedInds.begin();
for ( std::vector<CurvatureInfo>::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it ) {
unsigned long index = it - _lValueList.begin();
if (pos == uSortedInds.end())
remainValue.push_back( *it );
else if (index != *pos)
remainValue.push_back( *it );
else
pos++;
}
setValues(remainValue);
}
void PropertyCurvatureList::Save (Base::Writer &writer) const
{
if (!writer.isForceXML()) {
writer.Stream() << writer.ind() << "<CurvatureList file=\"" << writer.addFile(getName(), this) << "\"/>" << std::endl;
}
}
void PropertyCurvatureList::Restore(Base::XMLReader &reader)
{
reader.readElement("CurvatureList");
std::string file (reader.getAttribute("file") );
if (!file.empty()) {
// initate a file read
reader.addFile(file.c_str(),this);
}
}
void PropertyCurvatureList::SaveDocFile (Base::Writer &writer) const
{
Base::OutputStream str(writer.Stream());
uint32_t uCt = (uint32_t)getSize();
str << uCt;
if (uCt > 0)
for (std::vector<CurvatureInfo>::const_iterator it = _lValueList.begin(); it != _lValueList.end(); ++it) {
str << it->fMaxCurvature << it->fMinCurvature;
str << it->cMaxCurvDir.x << it->cMaxCurvDir.y << it->cMaxCurvDir.z;
str << it->cMinCurvDir.x << it->cMinCurvDir.y << it->cMinCurvDir.z;
}
}
void PropertyCurvatureList::RestoreDocFile(Base::Reader &reader)
{
Base::InputStream str(reader);
uint32_t uCt=0;
str >> uCt;
std::vector<CurvatureInfo> values(uCt);
for (std::vector<CurvatureInfo>::iterator it = values.begin(); it != values.end(); ++it) {
str >> it->fMaxCurvature >> it->fMinCurvature;
str >> it->cMaxCurvDir.x >> it->cMaxCurvDir.y >> it->cMaxCurvDir.z;
str >> it->cMinCurvDir.x >> it->cMinCurvDir.y >> it->cMinCurvDir.z;
}
setValues(values);
}
App::Property *PropertyCurvatureList::Copy(void) const
{
PropertyCurvatureList* prop = new PropertyCurvatureList();
prop->_lValueList = this->_lValueList;
return prop;
}
void PropertyCurvatureList::Paste(const App::Property &from)
{
aboutToSetValue();
const PropertyCurvatureList& prop = dynamic_cast<const PropertyCurvatureList&>(from);
this->_lValueList = prop._lValueList;
hasSetValue();
}
unsigned int PropertyCurvatureList::getMemSize (void) const
{
return sizeof(CurvatureInfo) * this->_lValueList.size();
}

View File

@@ -0,0 +1,169 @@
/***************************************************************************
* Copyright (c) Juergen Riegel <juergen.riegel@web.de> *
* *
* 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 POINTS_POINTPROPERTIES_H
#define POINTS_POINTPROPERTIES_H
#include <vector>
#include <Base/Vector3D.h>
#include <Base/Matrix.h>
#include <Base/Reader.h>
#include <Base/Writer.h>
#include <App/PropertyStandard.h>
#include <App/PropertyGeo.h>
#include "Points.h"
namespace Points
{
/** Greyvalue property.
*/
class PointsExport PropertyGreyValue : public App::PropertyFloat
{
TYPESYSTEM_HEADER();
public:
PropertyGreyValue(void)
{
}
virtual ~PropertyGreyValue()
{
}
};
/**
* Own class to distinguish from real float list
*/
class PointsExport PropertyGreyValueList : public App::PropertyFloatList
{
TYPESYSTEM_HEADER();
public:
PropertyGreyValueList()
{
}
virtual ~PropertyGreyValueList()
{
}
/** @name Modify */
//@{
void removeIndices( const std::vector<unsigned long>& );
//@}
};
/**
* Own class to distinguish from real vector list
*/
class PointsExport PropertyNormalList : public App::PropertyVectorList
{
TYPESYSTEM_HEADER();
public:
PropertyNormalList()
{
}
virtual ~PropertyNormalList()
{
}
/** @name Modify */
//@{
void transform(const Base::Matrix4D &rclMat);
void removeIndices( const std::vector<unsigned long>& );
//@}
};
/** Curvature information. */
struct PointsExport CurvatureInfo
{
float fMaxCurvature, fMinCurvature;
Base::Vector3f cMaxCurvDir, cMinCurvDir;
};
/** The Curvature property class.
*/
class PointsExport PropertyCurvatureList: public App::PropertyLists
{
TYPESYSTEM_HEADER();
public:
enum {
MeanCurvature = 0, /**< Mean curvature */
GaussCurvature = 1, /**< Gaussian curvature */
MaxCurvature = 2, /**< Maximum curvature */
MinCurvature = 3, /**< Minimum curvature */
AbsCurvature = 4 /**< Absolute curvature */
};
public:
PropertyCurvatureList();
~PropertyCurvatureList();
void setSize(int newSize){_lValueList.resize(newSize);}
int getSize(void) const {return _lValueList.size();}
void setValue(const CurvatureInfo&);
void setValues(const std::vector<CurvatureInfo>&);
std::vector<float> getCurvature( int tMode) const;
/// index operator
const CurvatureInfo& operator[] (const int idx) const {return _lValueList.operator[] (idx);}
void set1Value (const int idx, const CurvatureInfo& value){_lValueList.operator[] (idx) = value;}
const std::vector<CurvatureInfo> &getValues(void) const{return _lValueList;}
/** @name Save/restore */
//@{
void Save (Base::Writer &writer) const;
void Restore(Base::XMLReader &reader);
void SaveDocFile (Base::Writer &writer) const;
void RestoreDocFile(Base::Reader &reader);
//@}
/** @name Undo/Redo */
//@{
/// returns a new copy of the property (mainly for Undo/Redo and transactions)
App::Property *Copy(void) const;
/// paste the value from the property (mainly for Undo/Redo and transactions)
void Paste(const App::Property &from);
unsigned int getMemSize (void) const;
//@}
/** @name Modify */
//@{
void transform(const Base::Matrix4D &rclMat);
void removeIndices( const std::vector<unsigned long>& );
//@}
private:
std::vector<CurvatureInfo> _lValueList;
};
} // namespace Points
#endif // POINTS_POINTPROPERTIES_H

View File

@@ -0,0 +1,197 @@
/***************************************************************************
* Copyright (c) 2006 Werner Mayer <wmayer[at]users.sourceforge.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 <cmath>
# include <iostream>
# include <algorithm>
#endif
#include <Base/Exception.h>
#include <Base/Matrix.h>
#include <Base/Stream.h>
#include <Base/Writer.h>
#include "PropertyPointKernel.h"
#include "PointsPy.h"
using namespace Points;
TYPESYSTEM_SOURCE(Points::PropertyPointKernel , App::PropertyComplexGeoData);
PropertyPointKernel::PropertyPointKernel()
: _cPoints(new PointKernel())
{
}
PropertyPointKernel::~PropertyPointKernel()
{
}
void PropertyPointKernel::setValue(const PointKernel& m)
{
aboutToSetValue();
*_cPoints = m;
hasSetValue();
}
const PointKernel& PropertyPointKernel::getValue(void) const
{
return *_cPoints;
}
const Data::ComplexGeoData* PropertyPointKernel::getComplexData() const
{
return _cPoints;
}
Base::BoundBox3d PropertyPointKernel::getBoundingBox() const
{
Base::BoundBox3d box;
for (PointKernel::const_iterator it = _cPoints->begin(); it != _cPoints->end(); ++it)
box.Add(*it);
return box;
}
void PropertyPointKernel::getFaces(std::vector<Base::Vector3d> &Points,
std::vector<Data::ComplexGeoData::Facet> &Topo,
float Accuracy, uint16_t flags) const
{
_cPoints->getFaces(Points, Topo, Accuracy, flags);
}
PyObject *PropertyPointKernel::getPyObject(void)
{
PointsPy* points = new PointsPy(&*_cPoints);
points->setConst(); // set immutable
return points;
}
void PropertyPointKernel::setPyObject(PyObject *value)
{
if (PyObject_TypeCheck(value, &(PointsPy::Type))) {
PointsPy *pcObject = (PointsPy*)value;
setValue( *(pcObject->getPointKernelPtr()));
}
else {
std::string error = std::string("type must be 'Points', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
}
}
void PropertyPointKernel::Save (Base::Writer &writer) const
{
_cPoints->Save(writer);
}
void PropertyPointKernel::Restore(Base::XMLReader &reader)
{
reader.readElement("Points");
std::string file (reader.getAttribute("file") );
if (!file.empty()) {
// initate a file read
reader.addFile(file.c_str(),this);
}
if(reader.DocumentSchema > 3)
{
std::string Matrix (reader.getAttribute("mtrx") );
Base::Matrix4D mtrx;
mtrx.fromString(Matrix);
aboutToSetValue();
_cPoints->setTransform(mtrx);
hasSetValue();
}
}
void PropertyPointKernel::SaveDocFile (Base::Writer &writer) const
{
// does nothing
}
void PropertyPointKernel::RestoreDocFile(Base::Reader &reader)
{
aboutToSetValue();
_cPoints->RestoreDocFile(reader);
hasSetValue();
}
App::Property *PropertyPointKernel::Copy(void) const
{
PropertyPointKernel* prop = new PropertyPointKernel();
(*prop->_cPoints) = (*this->_cPoints);
return prop;
}
void PropertyPointKernel::Paste(const App::Property &from)
{
aboutToSetValue();
const PropertyPointKernel& prop = dynamic_cast<const PropertyPointKernel&>(from);
*(this->_cPoints) = *(prop._cPoints);
hasSetValue();
}
unsigned int PropertyPointKernel::getMemSize (void) const
{
return sizeof(Base::Vector3f) * this->_cPoints->size();
}
void PropertyPointKernel::removeIndices( const std::vector<unsigned long>& uIndices )
{
// We need a sorted array
std::vector<unsigned long> uSortedInds = uIndices;
std::sort(uSortedInds.begin(), uSortedInds.end());
assert( uSortedInds.size() <= _cPoints->size() );
if ( uSortedInds.size() > _cPoints->size() )
return;
PointKernel kernel;
kernel.setTransform(_cPoints->getTransform());
kernel.reserve(_cPoints->size() - uSortedInds.size());
std::vector<unsigned long>::iterator pos = uSortedInds.begin();
unsigned long index = 0;
for (PointKernel::const_iterator it = _cPoints->begin(); it != _cPoints->end(); ++it, ++index) {
if (pos == uSortedInds.end())
kernel.push_back( *it );
else if (index != *pos)
kernel.push_back( *it );
else
pos++;
}
setValue(kernel);
}
void PropertyPointKernel::transformGeometry(const Base::Matrix4D &rclMat)
{
aboutToSetValue();
_cPoints->transformGeometry(rclMat);
hasSetValue();
}

View File

@@ -0,0 +1,98 @@
/***************************************************************************
* Copyright (c) 2006 Werner Mayer <wmayer[at]users.sourceforge.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 POINTS_PROPERTYPOINTKERNEL_H
#define POINTS_PROPERTYPOINTKERNEL_H
#include "Points.h"
namespace Points
{
/** The point kernel property
*/
class PointsExport PropertyPointKernel : public App::PropertyComplexGeoData
{
TYPESYSTEM_HEADER();
public:
PropertyPointKernel();
~PropertyPointKernel();
/** @name Getter/setter */
//@{
/// Sets the points to the property
void setValue( const PointKernel& m);
/// get the points (only const possible!)
const PointKernel &getValue(void) const;
const Data::ComplexGeoData* getComplexData() const;
//@}
/** @name Getting basic geometric entities */
//@{
/** Returns the bounding box around the underlying mesh kernel */
Base::BoundBox3d getBoundingBox() const;
/** Get faces from object with given accuracy */
virtual void getFaces(std::vector<Base::Vector3d> &Points,
std::vector<Data::ComplexGeoData::Facet> &Topo,
float Accuracy, uint16_t flags=0) const;
//@}
/** @name Python interface */
//@{
PyObject* getPyObject(void);
void setPyObject(PyObject *value);
//@}
/** @name Undo/Redo */
//@{
/// returns a new copy of the property (mainly for Undo/Redo and transactions)
App::Property *Copy(void) const;
/// paste the value from the property (mainly for Undo/Redo and transactions)
void Paste(const App::Property &from);
unsigned int getMemSize (void) const;
//@}
/** @name Save/restore */
//@{
void Save (Base::Writer &writer) const;
void Restore(Base::XMLReader &reader);
void SaveDocFile (Base::Writer &writer) const;
void RestoreDocFile(Base::Reader &reader);
//@}
/** @name Modification */
//@{
/// Transform the real 3d point kernel
void transformGeometry(const Base::Matrix4D &rclMat);
void removeIndices( const std::vector<unsigned long>& );
//@}
private:
Base::Reference<PointKernel> _cPoints;
};
} // namespace Points
#endif // POINTS_PROPERTYPOINTKERNEL_H

View File

@@ -0,0 +1,13 @@
add_subdirectory(App)
if(FREECAD_BUILD_GUI)
add_subdirectory(Gui)
endif(FREECAD_BUILD_GUI)
install(
FILES
Init.py
InitGui.py
DESTINATION
Mod/Points
)

View File

@@ -0,0 +1,89 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
* *
* 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/Console.h>
#include <Base/Interpreter.h>
#include <Gui/Application.h>
#include <Gui/Language/Translator.h>
#include <Mod/Points/App/PropertyPointKernel.h>
#include "ViewProvider.h"
#include "Workbench.h"
#include "qrc_Points.cpp"
// use a different name to CreateCommand()
void CreatePointsCommands(void);
void loadPointsResource()
{
// add resources and reloads the translators
Q_INIT_RESOURCE(Points);
Gui::Translator::instance()->refresh();
}
/* registration table */
static struct PyMethodDef PointsGui_methods[] = {
{NULL, NULL} /* end of table marker */
};
/* Python entry */
extern "C" {
void PointsGuiExport initPointsGui()
{
if (!Gui::Application::Instance) {
PyErr_SetString(PyExc_ImportError, "Cannot load Gui module in console application.");
return;
}
// load dependent module
try {
Base::Interpreter().loadModule("Points");
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
return;
}
Base::Console().Log("Loading GUI of Points module... done\n");
(void) Py_InitModule("PointsGui", PointsGui_methods); /* mod name, table ptr */
// instantiating the commands
CreatePointsCommands();
PointsGui::ViewProviderPoints::init();
PointsGui::ViewProviderPython::init();
PointsGui::Workbench ::init();
Gui::ViewProviderBuilder::add(
Points::PropertyPointKernel::getClassTypeId(),
PointsGui::ViewProviderPoints::getClassTypeId());
// add resources and reloads the translators
loadPointsResource();
}
} // extern "C"

View File

@@ -0,0 +1,74 @@
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${Boost_INCLUDE_DIRS}
${COIN3D_INCLUDE_DIR}
${PYTHON_INCLUDE_PATH}
${SOQT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${XERCESC_INCLUDE_DIR}
)
set(PointsGui_LIBS
Points
FreeCADGui
)
set(PointsGui_MOC_HDRS
DlgPointsReadImp.h
)
fc_wrap_cpp(PointsGui_MOC_SRCS ${PointsGui_MOC_HDRS})
SOURCE_GROUP("Moc" FILES ${PointsGui_MOC_SRCS})
set(Dialog_UIC_SRCS
DlgPointsRead.ui
)
qt4_wrap_ui(Dialogs_UIC_HDRS ${Dialog_UIC_SRCS})
SET(Dialogs_SRCS
${Dialogs_UIC_HDRS}
DlgPointsRead.ui
DlgPointsReadImp.cpp
DlgPointsReadImp.h
)
SOURCE_GROUP("Dialogs" FILES ${Dialogs_SRCS})
fc_add_resources(Resource_SRCS Resources/Points.qrc)
SET(Resource_SRCS
# ${Resource_SRCS}
Resources/Points.qrc
)
SOURCE_GROUP("Resource" FILES ${Resource_SRCS})
SET(PointsGui_SRCS
${Dialogs_SRCS}
${Resource_SRCS}
AppPointsGui.cpp
Command.cpp
PreCompiled.cpp
PreCompiled.h
ViewProvider.cpp
ViewProvider.h
Workbench.cpp
Workbench.h
)
add_library(PointsGui SHARED ${PointsGui_SRCS})
target_link_libraries(PointsGui ${PointsGui_LIBS})
fc_copy_script("Mod/Points" "PointsGui" InitGui.py)
if(MSVC)
set_target_properties(PointsGui PROPERTIES SUFFIX ".pyd")
set_target_properties(PointsGui PROPERTIES DEBUG_OUTPUT_NAME "PointsGui_d")
set_target_properties(PointsGui PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/Points)
set_target_properties(PointsGui PROPERTIES PREFIX "../")
elseif(MINGW)
set_target_properties(PointsGui PROPERTIES SUFFIX ".pyd")
set_target_properties(PointsGui PROPERTIES DEBUG_OUTPUT_NAME "PointsGui_d")
set_target_properties(PointsGui PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/Points)
set_target_properties(PointsGui PROPERTIES PREFIX "")
else(MSVC)
set_target_properties(PointsGui PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Mod/Points)
set_target_properties(PointsGui PROPERTIES PREFIX "")
endif(MSVC)
install(TARGETS PointsGui DESTINATION lib)

View File

@@ -0,0 +1,231 @@
/***************************************************************************
* Copyright (c) 2006 Werner Mayer <wmayer[at]users.sourceforge.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 <qaction.h>
# include <qdir.h>
# include <qfileinfo.h>
# include <Inventor/events/SoMouseButtonEvent.h>
#endif
#include <Base/Exception.h>
#include <Base/Matrix.h>
#include <App/Document.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/Command.h>
#include <Gui/FileDialog.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/View3DInventor.h>
#include <Gui/View3DInventorViewer.h>
#include "../App/PointsFeature.h"
#include "DlgPointsReadImp.h"
#include "ViewProvider.h"
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//===========================================================================
// CmdPointsImport
//===========================================================================
DEF_STD_CMD_A(CmdPointsImport);
CmdPointsImport::CmdPointsImport()
:Command("Points_Import")
{
sAppModule = "Points";
sGroup = QT_TR_NOOP("Points");
sMenuText = QT_TR_NOOP("Import points...");
sToolTipText = QT_TR_NOOP("Imports a point cloud");
sWhatsThis = QT_TR_NOOP("Imports a point cloud");
sStatusTip = QT_TR_NOOP("Imports a point cloud");
sPixmap = "Test1";
}
void CmdPointsImport::activated(int iMsg)
{
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
QString::null, QString(), QObject::tr("Ascii Points (*.asc);;All Files (*.*)"));
if ( fn.isEmpty() )
return;
if (! fn.isEmpty() )
{
QFileInfo fi;
fi.setFile(fn);
openCommand("Points Import Create");
doCommand(Doc,"f = App.ActiveDocument.addObject(\"Points::ImportAscii\",\"%s\")", (const char*)fi.baseName().toAscii());
doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toAscii());
commitCommand();
updateActive();
}
}
bool CmdPointsImport::isActive(void)
{
if( getActiveGuiDocument() )
return true;
else
return false;
}
DEF_STD_CMD_A(CmdPointsExport);
CmdPointsExport::CmdPointsExport()
:Command("Points_Export")
{
sAppModule = "Points";
sGroup = QT_TR_NOOP("Points");
sMenuText = QT_TR_NOOP("Export points...");
sToolTipText = QT_TR_NOOP("Exports a point cloud");
sWhatsThis = QT_TR_NOOP("Exports a point cloud");
sStatusTip = QT_TR_NOOP("Exports a point cloud");
sPixmap = "Test2";
}
void CmdPointsExport::activated(int iMsg)
{
QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(),
QString::null, QString(), QObject::tr("Ascii Points (*.asc);;All Files (*.*)"));
if ( fn.isEmpty() )
return;
if (! fn.isEmpty() )
{
QFileInfo fi;
fi.setFile(fn);
openCommand("Export Points");
std::vector<App::DocumentObject*> points = getSelection().getObjectsOfType(Points::Feature::getClassTypeId());
doCommand(Doc,"f = App.ActiveDocument.addObject(\"Points::Export\",\"%s\")", (const char*)fi.baseName().toAscii());
doCommand(Doc,"f.FileName = \"%s\"",(const char*)fn.toAscii());
doCommand(Doc,"l=list()");
for ( std::vector<App::DocumentObject*>::const_iterator it = points.begin(); it != points.end(); ++it )
{
doCommand(Doc,"l.append(App.ActiveDocument.getObject(\"%s\"))",(*it)->getNameInDocument());
}
doCommand(Doc,"f.Sources = l");
commitCommand();
updateActive();
}
}
bool CmdPointsExport::isActive(void)
{
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
}
DEF_STD_CMD_A(CmdPointsTransform);
CmdPointsTransform::CmdPointsTransform()
:Command("Points_Transform")
{
sAppModule = "Points";
sGroup = QT_TR_NOOP("Points");
sMenuText = QT_TR_NOOP("Transform Points");
sToolTipText = QT_TR_NOOP("Test to transform a point cloud");
sWhatsThis = QT_TR_NOOP("Test to transform a point cloud");
sStatusTip = QT_TR_NOOP("Test to transform a point cloud");
sPixmap = "Test1";
}
void CmdPointsTransform::activated(int iMsg)
{
// This is a test command to transform a point cloud directly written in C++ (not Python)
Base::Placement trans;
trans.setRotation(Base::Rotation(Base::Vector3d(0.0, 0.0, 1.0), 1.570796));
openCommand("Transform points");
//std::vector<App::DocumentObject*> points = getSelection().getObjectsOfType(Points::Feature::getClassTypeId());
//for (std::vector<App::DocumentObject*>::const_iterator it = points.begin(); it != points.end(); ++it) {
// Base::Placement p = static_cast<Points::Feature*>(*it)->Placement.getValue();
// p._rot *= Base::Rotation(Base::Vector3d(0.0, 0.0, 1.0), 1.570796);
// static_cast<Points::Feature*>(*it)->Placement.setValue(p);
//}
commitCommand();
}
bool CmdPointsTransform::isActive(void)
{
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
}
DEF_STD_CMD_A(CmdPointsPolyCut);
CmdPointsPolyCut::CmdPointsPolyCut()
:Command("Points_PolyCut")
{
sAppModule = "Points";
sGroup = QT_TR_NOOP("Points");
sMenuText = QT_TR_NOOP("Cut point cloud");
sToolTipText = QT_TR_NOOP("Cuts a point cloud with a picked polygon");
sWhatsThis = QT_TR_NOOP("Cuts a point cloud with a picked polygon");
sStatusTip = QT_TR_NOOP("Cuts a point cloud with a picked polygon");
sPixmap = "PolygonPick";
}
void CmdPointsPolyCut::activated(int iMsg)
{
std::vector<App::DocumentObject*> docObj = Gui::Selection().getObjectsOfType(Points::Feature::getClassTypeId());
for (std::vector<App::DocumentObject*>::iterator it = docObj.begin(); it != docObj.end(); ++it) {
if (it == docObj.begin()) {
Gui::Document* doc = getActiveGuiDocument();
Gui::MDIView* view = doc->getActiveView();
if (view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) {
Gui::View3DInventorViewer* viewer = ((Gui::View3DInventor*)view)->getViewer();
viewer->setEditing(true);
viewer->startSelection(Gui::View3DInventorViewer::Lasso);
viewer->addEventCallback(SoMouseButtonEvent::getClassTypeId(), PointsGui::ViewProviderPoints::clipPointsCallback);
}
else {
return;
}
}
Gui::ViewProvider* pVP = getActiveGuiDocument()->getViewProvider( *it );
pVP->startEditing();
}
}
bool CmdPointsPolyCut::isActive(void)
{
// Check for the selected mesh feature (all Mesh types)
return getSelection().countObjectsOfType(Points::Feature::getClassTypeId()) > 0;
}
void CreatePointsCommands(void)
{
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
rcCmdMgr.addCommand(new CmdPointsImport());
rcCmdMgr.addCommand(new CmdPointsExport());
rcCmdMgr.addCommand(new CmdPointsTransform());
rcCmdMgr.addCommand(new CmdPointsPolyCut());
}

View File

@@ -0,0 +1,380 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PointsGui::DlgPointsRead</class>
<widget class="QDialog" name="PointsGui::DlgPointsRead">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>394</width>
<height>631</height>
</rect>
</property>
<property name="windowTitle">
<string>ASCII points import</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Template:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxTrmplate"/>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox1">
<property name="title">
<string>Special lines</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="1" column="0">
<layout class="QGridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditClusterStart"/>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditComments"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel4">
<property name="text">
<string>Ignore lines starting with:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>Cluster by lines starting with:</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>First line:</string>
</property>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="radioButtonIgnore">
<property name="text">
<string>Ignore</string>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonNbrOfPoints">
<property name="text">
<string>Number of points</string>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox2">
<property name="title">
<string>Point format</string>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>6</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxNextBlock2">
<item>
<property name="text">
<string>none</string>
</property>
</item>
<item>
<property name="text">
<string>I,J,K (normal vector)</string>
</property>
</item>
<item>
<property name="text">
<string>I,K (normal vector 2D)</string>
</property>
</item>
<item>
<property name="text">
<string>R,G,B (color)</string>
</property>
</item>
<item>
<property name="text">
<string>I (Gray value)</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxNextBlock1">
<item>
<property name="text">
<string>none</string>
</property>
</item>
<item>
<property name="text">
<string>I,J,K (normal vector)</string>
</property>
</item>
<item>
<property name="text">
<string>I,K (normal vector 2D)</string>
</property>
</item>
<item>
<property name="text">
<string>R,G,B (color)</string>
</property>
</item>
<item>
<property name="text">
<string>I (Gray value)</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel6">
<property name="text">
<string>Number separator:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="textLabel8_2_2">
<property name="text">
<string>Next block:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="textLabel8">
<property name="text">
<string>Next block:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="textLabel8_2">
<property name="text">
<string>Next block:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxNextBlock3">
<item>
<property name="text">
<string>none</string>
</property>
</item>
<item>
<property name="text">
<string>I,J,K (normal vector)</string>
</property>
</item>
<item>
<property name="text">
<string>I,K (normal vector 2D)</string>
</property>
</item>
<item>
<property name="text">
<string>R,G,B (color)</string>
</property>
</item>
<item>
<property name="text">
<string>I (Gray value)</string>
</property>
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxSeparator">
<property name="editable">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>,</string>
</property>
</item>
<item>
<property name="text">
<string>;</string>
</property>
</item>
<item>
<property name="text">
<string>\t</string>
</property>
</item>
<item>
<property name="text">
<string>\w</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxPointsFormat">
<item>
<property name="text">
<string>X,Y,Z</string>
</property>
</item>
<item>
<property name="text">
<string>X,Y</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel7">
<property name="text">
<string>Points format:</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox3">
<property name="title">
<string>Preview</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>6</number>
</property>
<item>
<widget class="QLineEdit" name="lineEditFileName">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="textLabel5">
<property name="text">
<string>Number of previewed lines:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditPreviewLines">
<property name="text">
<string>100</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="textEditPreview"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<tabstops>
<tabstop>comboBoxTrmplate</tabstop>
<tabstop>radioButtonIgnore</tabstop>
<tabstop>radioButtonNbrOfPoints</tabstop>
<tabstop>lineEditClusterStart</tabstop>
<tabstop>lineEditComments</tabstop>
<tabstop>comboBoxSeparator</tabstop>
<tabstop>comboBoxPointsFormat</tabstop>
<tabstop>comboBoxNextBlock1</tabstop>
<tabstop>comboBoxNextBlock2</tabstop>
<tabstop>comboBoxNextBlock3</tabstop>
<tabstop>lineEditFileName</tabstop>
<tabstop>lineEditPreviewLines</tabstop>
<tabstop>textEditPreview</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,50 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
* *
* 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 "DlgPointsReadImp.h"
using namespace PointsGui;
DlgPointsReadImp::DlgPointsReadImp(const char *FileName, QWidget* parent, Qt::WFlags fl )
: QDialog( parent, fl )
{
_FileName = FileName;
}
/*
* Destroys the object and frees any allocated resources
*/
DlgPointsReadImp::~DlgPointsReadImp()
{
// no need to delete child widgets, Qt does it all for us
}
#include "moc_DlgPointsReadImp.cpp"

View File

@@ -0,0 +1,48 @@
/***************************************************************************
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
* *
* 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 POINTSGUI_DLGREADPOINTS_H
#define POINTSGUI_DLGREADPOINTS_H
#include <string>
#include "ui_DlgPointsRead.h"
namespace PointsGui {
/** The points read dialog
*/
class DlgPointsReadImp : public QDialog, public Ui_DlgPointsRead
{
Q_OBJECT
public:
DlgPointsReadImp(const char *FileName, QWidget* parent = 0, Qt::WFlags fl = 0 );
~DlgPointsReadImp();
private:
std::string _FileName;
};
} // namespace PointsGui
#endif // POINTSGUI_DLGREADPOINTS_H

View File

@@ -0,0 +1,113 @@
lib_LTLIBRARIES=libPointsGui.la PointsGui.la
BUILT_SOURCES=\
ui_DlgPointsRead.h \
moc_DlgPointsReadImp.cpp \
qrc_Points.cpp
libPointsGui_la_SOURCES=\
Command.cpp \
DlgPointsReadImp.cpp \
DlgPointsReadImp.h \
PreCompiled.cpp \
PreCompiled.h \
ViewProvider.cpp \
Workbench.cpp
includedir = @includedir@/Mod/Points/Gui
include_HEADERS=\
ViewProvider.h \
Workbench.h
# the library search path.
libPointsGui_la_LDFLAGS = -L../../../Base -L../../../App -L../../../Gui -L../App $(QT_LIBS) \
$(sim_ac_coin_libs) $(sim_ac_soqt_libs) $(all_libraries) \
-version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@
libPointsGui_la_CPPFLAGS = -DPointsAppExport= -DPointsGuiExport=
libPointsGui_la_LIBADD = \
@BOOST_SYSTEM_LIB@ \
-l@PYTHON_LIB@ \
-lxerces-c \
-lFreeCADBase \
-lFreeCADApp \
-lFreeCADGui \
-lPoints
#--------------------------------------------------------------------------------------
# Loader of libPointsGui
PointsGui_la_SOURCES=\
AppPointsGui.cpp
# the library search path.
PointsGui_la_LDFLAGS = $(libPointsGui_la_LDFLAGS) -module -avoid-version
PointsGui_la_CPPFLAGS = $(libPointsGui_la_CPPFLAGS)
PointsGui_la_LIBADD = \
$(libPointsGui_la_LIBADD) \
-lPointsGui
PointsGui_la_DEPENDENCIES = libPointsGui.la
#--------------------------------------------------------------------------------------
# rule for Qt MetaObject Compiler:
moc_%.cpp: %.h
$(QT_MOC) $< -o $(@F)
# rule for Qt MetaObject Compiler:
%.moc: %.h
$(QT_MOC) $< -o $(@F)
# rules for Qt User Interface Compiler:
ui_%.h: %.ui
$(QT_UIC) $< -o $(@F)
# rules for Qt Resource Compiler:
qrc_%.cpp: Resources/%.qrc
$(QT_RCC) -name $(*F) $< -o $(@F)
# set the include path found by configure
AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src $(all_includes) $(QT_CXXFLAGS) \
-I$(sim_ac_coin_includedir) -I$(sim_ac_soqt_includedir)
libdir = $(prefix)/Mod/Points
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = \
DlgPointsRead.ui \
CMakeLists.txt \
Resources/Points.qrc \
Resources/translations/Points_af.qm \
Resources/translations/Points_af.ts \
Resources/translations/Points_de.qm \
Resources/translations/Points_de.ts \
Resources/translations/Points_es.qm \
Resources/translations/Points_es.ts \
Resources/translations/Points_fi.qm \
Resources/translations/Points_fi.ts \
Resources/translations/Points_fr.qm \
Resources/translations/Points_fr.ts \
Resources/translations/Points_hr.qm \
Resources/translations/Points_hr.ts \
Resources/translations/Points_it.qm \
Resources/translations/Points_it.ts \
Resources/translations/Points_nl.qm \
Resources/translations/Points_nl.ts \
Resources/translations/Points_no.qm \
Resources/translations/Points_no.ts \
Resources/translations/Points_pt.qm \
Resources/translations/Points_pt.ts \
Resources/translations/Points_ru.qm \
Resources/translations/Points_ru.ts \
Resources/translations/Points_se.qm \
Resources/translations/Points_se.ts \
Resources/translations/Points_uk.qm \
Resources/translations/Points_uk.ts \
Resources/translations/Points_zh.qm \
Resources/translations/Points_zh.ts

View File

@@ -0,0 +1,24 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
* *
* 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"

View File

@@ -0,0 +1,76 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2002 *
* *
* 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 POINTSGUI_PRECOMPILED_H
#define POINTSGUI_PRECOMPILED_H
#include <FCConfig.h>
// Importing of App classes
#ifdef FC_OS_WIN32
# define PointsExport __declspec(dllimport)
# define PointsGuiExport __declspec(dllexport)
#else // for Linux
# define PointsExport
# define PointsGuiExport
#endif
#ifdef _PreComp_
// standard
#include <stdio.h>
#include <assert.h>
// STL
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <bitset>
#include <Python.h>
#ifdef FC_OS_WIN32
# include <windows.h>
#endif
// Qt Toolkit
#ifndef __Qt4All__
# include <Gui/Qt4All.h>
#endif
// Inventor
#ifndef __InventorAll__
# include <Gui/InventorAll.h>
#endif
#endif //_PreComp_
#endif // POINTSGUI_PRECOMPILED_H

View File

@@ -0,0 +1,18 @@
<RCC>
<qresource>
<file>translations/Points_af.qm</file>
<file>translations/Points_de.qm</file>
<file>translations/Points_es.qm</file>
<file>translations/Points_fi.qm</file>
<file>translations/Points_fr.qm</file>
<file>translations/Points_hr.qm</file>
<file>translations/Points_it.qm</file>
<file>translations/Points_nl.qm</file>
<file>translations/Points_no.qm</file>
<file>translations/Points_pt.qm</file>
<file>translations/Points_ru.qm</file>
<file>translations/Points_se.qm</file>
<file>translations/Points_uk.qm</file>
<file>translations/Points_zh.qm</file>
</qresource>
</RCC>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Punte</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Voer punte uit...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Voer 'n puntwolk uit</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Punte</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Voer punte in...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Voer 'n puntwolk in</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Punte</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Sny 'n puntwolk</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Sny 'n puntwolk met 'n gekose veelhoek</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Punte</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Transformeer Punte</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Toets om 'n puntwolk te transformeer</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Voer ASCII-punte in</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Standaardvorm:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Spesiale lyne</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Eerste lyn:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ignoreer</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Groepeer lyne wat begin met:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignoreer lyne wat begin met:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Puntformaat</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Syferverdeler:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Puntformaat:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Volgende blok:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>geen</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (normale vektor)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (gewone vektor 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (kleur)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (Gryswaarde)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Voorskou</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Aantal punte</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Aantal voorskoulyne:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punte-gereedskap</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punte</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Ascii Punte (*.asc);;Alle Lêers (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punte-gereedskap</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punte</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,251 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de_DE">
<context>
<name>CmdPointsExport</name>
<message>
<location filename="../../Command.cpp" line="+104"/>
<source>Points</source>
<translation>Punkte</translation>
</message>
<message>
<location line="+1"/>
<source>Export points...</source>
<translation>Punkte exportieren...</translation>
</message>
<message>
<location line="+1"/>
<location line="+1"/>
<location line="+1"/>
<source>Exports a point cloud</source>
<translation>Exportiert eine Punktwolke</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location line="-47"/>
<source>Points</source>
<translation>Punkte</translation>
</message>
<message>
<location line="+1"/>
<source>Import points...</source>
<translation>Punkte importieren...</translation>
</message>
<message>
<location line="+1"/>
<location line="+1"/>
<location line="+1"/>
<source>Imports a point cloud</source>
<translation>Importiert eine Punktwolke</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location line="+122"/>
<source>Points</source>
<translation>Punkte</translation>
</message>
<message>
<location line="+1"/>
<source>Cut point cloud</source>
<translation>Schneidet Punktwolke</translation>
</message>
<message>
<location line="+1"/>
<location line="+1"/>
<location line="+1"/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Ausschneiden einer Punktwolke aus dem gewählten Polygon</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location line="-39"/>
<source>Points</source>
<translation>Punkte</translation>
</message>
<message>
<location line="+1"/>
<source>Transform Points</source>
<translation>Transformiere Punkte</translation>
</message>
<message>
<location line="+1"/>
<location line="+1"/>
<location line="+1"/>
<source>Test to transform a point cloud</source>
<translation>Test zur Transformation einer Punktwolke</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location filename="../../DlgPointsRead.ui" line="+14"/>
<source>ASCII points import</source>
<translation>ASCII-Punkte-Import</translation>
</message>
<message>
<location line="+20"/>
<source>Template:</source>
<translation>Vorlage:</translation>
</message>
<message>
<location line="+12"/>
<source>Special lines</source>
<translation>Spezielle Zeilen</translation>
</message>
<message>
<location line="+42"/>
<source>First line:</source>
<translation>Erste Zeile:</translation>
</message>
<message>
<location line="+12"/>
<source>Ignore</source>
<translation>Ignorieren</translation>
</message>
<message>
<location line="-21"/>
<source>Cluster by lines starting with:</source>
<translation>Cluster von Zeilen beginnend mit:</translation>
</message>
<message>
<location line="-7"/>
<source>Ignore lines starting with:</source>
<translation>Ignoriere Zeilen beginnend mit:</translation>
</message>
<message>
<location line="+54"/>
<source>Point format</source>
<translation>Punkte-Format</translation>
</message>
<message>
<location line="+78"/>
<source>Number separator:</source>
<translation>Zahlentrenner:</translation>
</message>
<message>
<location line="+98"/>
<source>Points format:</source>
<translation>Punkte-Format:</translation>
</message>
<message>
<location line="-91"/>
<location line="+7"/>
<location line="+7"/>
<source>Next block:</source>
<translation>Nächster Block:</translation>
</message>
<message>
<location line="+40"/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location line="+5"/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location line="+5"/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location line="+5"/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location line="+9"/>
<source>X,Y,Z</source>
<translation>X, Y, Z</translation>
</message>
<message>
<location line="+5"/>
<source>X,Y</source>
<translation>X, Y</translation>
</message>
<message>
<location line="-147"/>
<location line="+29"/>
<location line="+57"/>
<source>none</source>
<translation>keiner</translation>
</message>
<message>
<location line="-81"/>
<location line="+29"/>
<location line="+57"/>
<source>I,J,K (normal vector)</source>
<translation>I, J, K (Normalenvektor)</translation>
</message>
<message>
<location line="-81"/>
<location line="+29"/>
<location line="+57"/>
<source>I,K (normal vector 2D)</source>
<translation>I, K (Normalenvektor 2D)</translation>
</message>
<message>
<location line="-81"/>
<location line="+29"/>
<location line="+57"/>
<source>R,G,B (color)</source>
<translation>R,G,B (Farbe)</translation>
</message>
<message>
<location line="-81"/>
<location line="+29"/>
<location line="+57"/>
<source>I (Gray value)</source>
<translation>I (Grauwert)</translation>
</message>
<message>
<location line="+61"/>
<source>Preview</source>
<translation>Vorschau</translation>
</message>
<message>
<location line="+34"/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location line="-238"/>
<source>Number of points</source>
<translation>Anzahl der Punkte</translation>
</message>
<message>
<location line="+231"/>
<source>Number of previewed lines:</source>
<translation>Anzahl der angezeigten Zeilen:</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../../Command.cpp" line="-84"/>
<location line="+43"/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>ASCII-Punkte (.asc); Alle Dateien (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location filename="../../Workbench.cpp" line="+37"/>
<source>Points tools</source>
<translation>Punktwerkzeuge</translation>
</message>
<message>
<location line="+1"/>
<source>&amp;Points</source>
<translation>&amp;Punkte</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Puntos</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Exportar puntos...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>exporta una nube de puntos</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Puntos</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Importar puntos...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Importa una nube de puntos</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Puntos</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Cortar una nube de puntos</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Corta una nube de puntos con un poligono seleccionado</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Puntos</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Trasformar puntos</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Test para transformar una nube de puntos</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Importar puntos ASCII</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Plantilla:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Líneas especiales</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Primera línea:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ignorar</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Agrupar por líneas que empiezan con:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignorar líneas que empiezan con:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Formato de punto</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Número separador:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Formato de punto:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Próximo bloque:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>ninguno</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (vector normal)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (vector normal 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (color)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (valor de gris)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Previsualizar</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Número de puntos</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Número de líneas previsualizadas:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Herramientas de puntos</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Puntos</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Puntos Ascii (*.asc);;Todos los archivos (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Herramientas de puntos</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Puntos</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Pisteet</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Vie pisteet...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Exports a point cloud</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Pisteet</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Tuo pisteet...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Imports a point cloud</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Pisteet</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Cut point cloud</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Cuts a point cloud with a picked polygon</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Pisteet</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Muunna pisteet</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Testaa muuttaa pistepilvi</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Tuo ASCII pisteet</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Malli:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Erityisiä viivoja</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Ensimmäinen rivi:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ohita</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Cluster by lines starting with:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignore lines starting with:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Point format</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Numero erotin:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Points format:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Seuraava lohko:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\T</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>/w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>ei mitään</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (normaali vektori)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (normaali vektori 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (väri)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (Gray arvo)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Esikatselu</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Pisteiden määrä</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Esikatseltavien rivien määrä:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Points tools</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Pisteet</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Ascii Points (*.asc);;All Files (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Points tools</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Pisteet</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Points</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Exporter les points...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Exporte un nuage de point</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Points</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Importer des points...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Importe un nuage de points</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Points</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Couper un nuage de points</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Coupe un nuage de points à l'aide d'un polygone sélectionné</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Points</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Transformer les points</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Test de transformation d'un nuage de points</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Import de points ASCII</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Modèle:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Ligne spéciales</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Première ligne:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ignorer</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Ensemble de lignes commençant par:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignorer les lignes commençant par:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Format de point</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Séparateur de nombres:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Format de points:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Bloc suivant:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X, Y, Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X, Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>aucun</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (vecteur normal)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (vecteur normal 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,V,B (couleur)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (valeur de gris)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Aperçu</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Nombre de points</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Nombre de lignes prévisualisés :</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Outils points</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Points</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Points Ascii (*.asc);;Tous les fichiers (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Outils points</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Points</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Točke</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Izvezi točke...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>prenesi pokazni oblak </translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Točke</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Uvezi točke...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>prenesi pokazni oblak</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Točke</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>odreži pokazni oblak</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Izreže pokazni oblak s bere poligona</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Točke</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Promijeni točke</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Test za pretvaranje pokaznog oblaka</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>ASCII uvoz bodova</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Predložak:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Posebne linije</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Prva linija:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Zanemari</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Klaster linijama koje počinju sa:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Zanemari linije koje počinju sa:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Point format</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Broj seperatora:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Bodovi formata:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Sljedeći blok:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>nijedan</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (vektor normale)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (vektor normale 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (u boji)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (vrijednosti u sivim tonovima)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Pregled</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Broj točaka</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Broj pregledanih linija:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Alati točaka</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Točke</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Ascii točke (*.asc);;Sve datoteke (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Alati točaka</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Točke</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Punti</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Esporta punti...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Esporta una nuvola di punti</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Punti</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Importa punti...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Importa una nuvola di punti</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Punti</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Taglia nuvola di punti</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Taglia una nuvola di punti con un poligono specificato</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Punti</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Trasforma punti</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Test della trasformazione di una nuvola di punti</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Importa punti ASCII</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Modello:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Linee speciali</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Prima linea:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ignora</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Raggruppamento per linee che iniziano con:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignora le linee che iniziano con:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Formato punto</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Numero separatore:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Formato punti:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Prossimo blocco:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>nessuno</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (vettore normale)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (vettore normale 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (colore)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (valore di grigio)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Anteprima</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Numero di punti</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Numero di linee visualizzate nell'anteprima:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Strumenti Punti</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punti</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Punti Ascii (*.asc);;Tutti i file (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Strumenti Punti</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punti</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Punten</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Exporteer punten...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Exporteert een puntenwolk</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Punten</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Importeer punten...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Importeert een puntenwolk</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Punten</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Snij puntenwolk</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Knipt een puntwolk met een geselecteerde veelhoek</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Punten</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Transformeer Punten</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Test om een puntwolk te transformeren</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>ASCII-punten import</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Sjabloon:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Speciale lijnen</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Eerste regel:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Negeren</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Clusteren van regels die beginnen met:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Negeer regels die beginnen met:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Punt-formaat</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Getal scheidingsteken:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Punten-formaat:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Volgend blok:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>(leeg)</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (normaalvector)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (normaalvector 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (kleur)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (Grijstint)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Voorbeeldweergave</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Aantal punten</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Aantal regels bekeken:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punten-gereedschap</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punten</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>ASCII-punten (*.asc);;alle bestanden (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punten-gereedschap</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punten</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Eksporter punkter...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Eksporterer en punktsky</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Importer punkt...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Importerer en punktsky</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Klipp ut punktsky</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Klipper ut en punktsky med valgt polygon</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Transformer punkter</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Test for å transformere en punktsky</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>ASCII punkt import</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Mal:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Spesielle linjer</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Første linje:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ignorer</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Klynge av linjer som starter med:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignorer linjer som starter med:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Punktformat</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Nummerseperator:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Punktformat:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Neste blokk:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>ingen</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (normal vektor)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (normal vektor 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (farge)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (Grå verdi)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Forhåndsvisning</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Antall punkter</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Antall forhåndsviste linjer:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punktverktøy</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punkter</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Ascii-punkter (*.asc);;Alle filer (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punktverktøy</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punkter</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Pontos</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Exportar pontos...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Exporta uma nuvem de pontos</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Pontos</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Importar pontos...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Importar uma nuvem de pontos</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Pontos</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Cortar nuvem de pontos</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Corta uma nuvem de pontos com um polígono traçado</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Pontos</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Transformar pontos</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Teste para transformar uma nuvem de pontos</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Importar pontos ASCII</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Modelo:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Linhas especiais</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Primeira linha:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ignorar</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Agrupar por linhas começando com:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignore linhas que comecem com:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Formato de ponto</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Separador de números:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Formato de pontos:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Próximo bloco:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>nenhum</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (vetor normal)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (vetor normal 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (cor)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (valor de cinza)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Pré-visualização</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Número de pontos</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Número de linhas visualizadas:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Ferramentas de pontos</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Pontos</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Pontos Ascii (*.asc);; Todos os Arquivos (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Ferramentas de pontos</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Pontos</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Экспорт точек...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Экспорт облака точек</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Импорт точек...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Импорт облака точек</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Вырезать облако точек</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Cuts a point cloud with a picked polygon</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Преобразование точек</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Test to transform a point cloud</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Импорт точек ASCII</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Шаблон:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Специальные линии</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Первая линия:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Игнорировать</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Cluster by lines starting with:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Игнорировать строки, начинающиеся с:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Формат точек</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Номер разделителя:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Формат точек:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Следующий блок:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X, Y, Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X, Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>Отсутствует</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K(нормальный вектор)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K(нормальный вектор 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R, G, B (цвет)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (значение серого)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Предварительный просмотр</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Количество точек</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Колличество предварительно просматриваемых строк:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Инструменты для точек</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Точки</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Точки Ascii (*.asc);;Все файлы (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Инструменты для точек</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Точки</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Exportera punkter...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Exporterar ett punktmoln</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Importera punkter...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Importera ett punktmoln</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Klipp ut punktmoln</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Klipper ut ett punktmoln med en vald polygon</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Punkter</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Omvandla punkter</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Testa att omforma ett punktmoln</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Importera ASCII punkter</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>mall:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Special linjer</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Första linjen:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ignorera</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Linjekluster startar med:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ignorera linjer som startar med:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Punktformat</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Talseparator:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Punktformat:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Nästa block:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X, Y, Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X, Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>inget</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (normalvektor)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (2D nomalvektor)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (färg)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (Gråton)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Förhandsvisning</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Antal punkter</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Antal förhandsgranskade rader:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punktverktyg</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punkter</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Ascii Punkter (*.asc);;Alla Filer (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Punktverktyg</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Punkter</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>Експорт точок...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation>Експорт хмари точок</translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>Імпорт точок...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation>Імпорт хмари точок</translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation>Вирізати хмару точок</translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation>Вирізати точки у виділеній області</translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation>Точки</translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation>Перетворення точок</translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation>Випробування для перетворення хмари точок</translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>Імпорт точок ASCII</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>Шаблон:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation>Спеціальні лінії</translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>Перший рядок:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation>Ігнорувати</translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>Скупчення по лінії, починаючи з:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>Ігнорувати рядки, що починаються з:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation>Формат точки</translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>Кількість роздільників:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>Формат точок:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>Наступний блок:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation>немає</translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K (нормальний вектор)</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K (нормальний вектор 2D)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>R,G,B (колір)</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I (Значення сірого)</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation>Попередній перегляд</translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation>Кількість точок</translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>Кількість ліній в попередньому перегляді:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Інструменти точок</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Точки</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Ascii точки (*.asc);;Всі файли (*.*)</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation>Інструменти точок</translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>&amp;Точки</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>CmdPointsExport</name>
<message>
<location/>
<source>Points</source>
<translation></translation>
</message>
<message>
<location/>
<source>Export points...</source>
<translation>...</translation>
</message>
<message>
<location/>
<source>Exports a point cloud</source>
<translation></translation>
</message>
</context>
<context>
<name>CmdPointsImport</name>
<message>
<location/>
<source>Points</source>
<translation></translation>
</message>
<message>
<location/>
<source>Import points...</source>
<translation>...</translation>
</message>
<message>
<location/>
<source>Imports a point cloud</source>
<translation></translation>
</message>
</context>
<context>
<name>CmdPointsPolyCut</name>
<message>
<location/>
<source>Points</source>
<translation></translation>
</message>
<message>
<location/>
<source>Cut point cloud</source>
<translation></translation>
</message>
<message>
<location/>
<source>Cuts a point cloud with a picked polygon</source>
<translation></translation>
</message>
</context>
<context>
<name>CmdPointsTransform</name>
<message>
<location/>
<source>Points</source>
<translation></translation>
</message>
<message>
<location/>
<source>Transform Points</source>
<translation></translation>
</message>
<message>
<location/>
<source>Test to transform a point cloud</source>
<translation></translation>
</message>
</context>
<context>
<name>PointsGui::DlgPointsRead</name>
<message>
<location/>
<source>ASCII points import</source>
<translation>ASCII点导入</translation>
</message>
<message>
<location/>
<source>Template:</source>
<translation>:</translation>
</message>
<message>
<location/>
<source>Special lines</source>
<translation></translation>
</message>
<message>
<location/>
<source>First line:</source>
<translation>:</translation>
</message>
<message>
<location/>
<source>Ignore</source>
<translation></translation>
</message>
<message>
<location/>
<source>Cluster by lines starting with:</source>
<translation>:</translation>
</message>
<message>
<location/>
<source>Ignore lines starting with:</source>
<translation>:</translation>
</message>
<message>
<location/>
<source>Point format</source>
<translation></translation>
</message>
<message>
<location/>
<source>Number seperator:</source>
<translation>:</translation>
</message>
<message>
<location/>
<source>Points format:</source>
<translation>:</translation>
</message>
<message>
<location/>
<source>Next block:</source>
<translation>:</translation>
</message>
<message>
<location/>
<source>,</source>
<translation>,</translation>
</message>
<message>
<location/>
<source>;</source>
<translation>;</translation>
</message>
<message>
<location/>
<source>\t</source>
<translation>\t</translation>
</message>
<message>
<location/>
<source>\w</source>
<translation>\w</translation>
</message>
<message>
<location/>
<source>X,Y,Z</source>
<translation>X,Y,Z</translation>
</message>
<message>
<location/>
<source>X,Y</source>
<translation>X,Y</translation>
</message>
<message>
<location/>
<source>none</source>
<translation></translation>
</message>
<message>
<location/>
<source>I,J,K (normal vector)</source>
<translation>I,J,K()</translation>
</message>
<message>
<location/>
<source>I,K (normal vector 2D)</source>
<translation>I,K(2D法向量)</translation>
</message>
<message>
<location/>
<source>R,G,B (color)</source>
<translation>RGB颜色</translation>
</message>
<message>
<location/>
<source>I (Gray value)</source>
<translation>I()</translation>
</message>
<message>
<location/>
<source>Preview</source>
<translation></translation>
</message>
<message>
<location/>
<source>100</source>
<translation>100</translation>
</message>
<message>
<location/>
<source>Number of points</source>
<translation></translation>
</message>
<message>
<location/>
<source>Number of previewed lines:</source>
<translation>:</translation>
</message>
</context>
<context>
<name>PointsGui::Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation></translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>(&amp;P)</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location/>
<source>Ascii Points (*.asc);;All Files (*.*)</source>
<translation>Ascii (*.asc), (*.*</translation>
</message>
</context>
<context>
<name>Workbench</name>
<message>
<location/>
<source>Points tools</source>
<translation></translation>
</message>
<message>
<location/>
<source>&amp;Points</source>
<translation>(&amp;P)</translation>
</message>
</context>
</TS>

View File

@@ -0,0 +1,480 @@
/***************************************************************************
* Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.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_
# ifdef FC_OS_WIN32
# include <windows.h>
# endif
# include <Inventor/nodes/SoCamera.h>
# include <Inventor/nodes/SoCoordinate3.h>
# include <Inventor/nodes/SoDrawStyle.h>
# include <Inventor/nodes/SoPointSet.h>
# include <Inventor/nodes/SoMaterial.h>
# include <Inventor/nodes/SoMaterialBinding.h>
# include <Inventor/nodes/SoNormal.h>
# include <Inventor/errors/SoDebugError.h>
# include <Inventor/events/SoMouseButtonEvent.h>
#endif
/// Here the FreeCAD includes sorted by Base,App,Gui,...
#include <Base/Console.h>
#include <Base/Parameter.h>
#include <Base/Exception.h>
#include <Base/Sequencer.h>
#include <Base/Tools2D.h>
#include <Base/Vector3D.h>
#include <App/Application.h>
#include <App/Document.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/SoFCSelection.h>
#include <Gui/View3DInventorViewer.h>
#include <Mod/Points/App/PointsFeature.h>
#include "ViewProvider.h"
#include "../App/Properties.h"
using namespace PointsGui;
using namespace Points;
PROPERTY_SOURCE(PointsGui::ViewProviderPoints, Gui::ViewProviderGeometryObject)
App::PropertyFloatConstraint::Constraints ViewProviderPoints::floatRange = {1.0f,64.0f,1.0f};
ViewProviderPoints::ViewProviderPoints()
{
ADD_PROPERTY(PointSize,(2.0f));
PointSize.setConstraints(&floatRange);
pcPointsCoord = new SoCoordinate3();
pcPointsCoord->ref();
pcPoints = new SoPointSet();
pcPoints->ref();
pcPointsNormal = new SoNormal();
pcPointsNormal->ref();
pcColorMat = new SoMaterial;
pcColorMat->ref();
pcPointStyle = new SoDrawStyle();
pcPointStyle->ref();
pcPointStyle->style = SoDrawStyle::POINTS;
pcPointStyle->pointSize = PointSize.getValue();
}
ViewProviderPoints::~ViewProviderPoints()
{
pcPointsCoord->unref();
pcPoints->unref();
pcPointsNormal->unref();
pcColorMat->unref();
pcPointStyle->unref();
}
void ViewProviderPoints::onChanged(const App::Property* prop)
{
if ( prop == &PointSize ) {
pcPointStyle->pointSize = PointSize.getValue();
}
else {
ViewProviderGeometryObject::onChanged(prop);
}
}
void ViewProviderPoints::setVertexColorMode(App::PropertyColorList* pcProperty)
{
const std::vector<App::Color>& val = pcProperty->getValues();
unsigned long i=0;
pcColorMat->enableNotify(false);
pcColorMat->diffuseColor.deleteValues(0);
pcColorMat->diffuseColor.setNum(val.size());
for ( std::vector<App::Color>::const_iterator it = val.begin(); it != val.end(); ++it ) {
pcColorMat->diffuseColor.set1Value(i++, SbColor(it->r, it->g, it->b));
}
pcColorMat->enableNotify(true);
pcColorMat->touch();
}
void ViewProviderPoints::setVertexGreyvalueMode(Points::PropertyGreyValueList* pcProperty)
{
const std::vector<float>& val = pcProperty->getValues();
unsigned long i=0;
pcColorMat->enableNotify(false);
pcColorMat->diffuseColor.deleteValues(0);
pcColorMat->diffuseColor.setNum(val.size());
for ( std::vector<float>::const_iterator it = val.begin(); it != val.end(); ++it ) {
pcColorMat->diffuseColor.set1Value(i++, SbColor(*it, *it, *it));
}
pcColorMat->enableNotify(true);
pcColorMat->touch();
}
void ViewProviderPoints::setVertexNormalMode(Points::PropertyNormalList* pcProperty)
{
const std::vector<Base::Vector3f>& val = pcProperty->getValues();
unsigned long i=0;
pcPointsNormal->enableNotify(false);
pcPointsNormal->vector.deleteValues(0);
pcPointsNormal->vector.setNum(val.size());
for ( std::vector<Base::Vector3f>::const_iterator it = val.begin(); it != val.end(); ++it ) {
pcPointsNormal->vector.set1Value(i++, it->x, it->y, it->z);
}
pcPointsNormal->enableNotify(true);
pcPointsNormal->touch();
}
void ViewProviderPoints::attach(App::DocumentObject* pcObj)
{
// call parent's attach to define display modes
ViewProviderGeometryObject::attach(pcObj);
SoGroup* pcPointRoot = new SoGroup();
SoGroup* pcPointShadedRoot = new SoGroup();
SoGroup* pcColorShadedRoot = new SoGroup();
// Hilight for selection
pcHighlight->addChild(pcPointsCoord);
pcHighlight->addChild(pcPoints);
// points part ---------------------------------------------
pcPointRoot->addChild(pcPointStyle);
pcPointRoot->addChild(pcShapeMaterial);
pcPointRoot->addChild(pcHighlight);
// points shaded ---------------------------------------------
pcPointShadedRoot->addChild(pcPointStyle);
pcPointShadedRoot->addChild(pcShapeMaterial);
pcPointShadedRoot->addChild(pcPointsNormal);
pcPointShadedRoot->addChild(pcHighlight);
// color shaded ------------------------------------------
pcColorShadedRoot->addChild(pcPointStyle);
SoMaterialBinding* pcMatBinding = new SoMaterialBinding;
pcMatBinding->value = SoMaterialBinding::PER_VERTEX_INDEXED;
pcColorShadedRoot->addChild(pcColorMat);
pcColorShadedRoot->addChild(pcMatBinding);
pcColorShadedRoot->addChild(pcHighlight);
// putting all together with a switch
addDisplayMaskMode(pcPointRoot, "Point");
addDisplayMaskMode(pcColorShadedRoot, "Color");
addDisplayMaskMode(pcPointShadedRoot, "Shaded");
}
void ViewProviderPoints::setDisplayMode(const char* ModeName)
{
int numPoints = pcPointsCoord->point.getNum();
if ( strcmp("Color",ModeName)==0 )
{
std::map<std::string,App::Property*> Map;
pcObject->getPropertyMap(Map);
for( std::map<std::string,App::Property*>::iterator it = Map.begin(); it != Map.end(); ++it )
{
Base::Type t = it->second->getTypeId();
if ( t==App::PropertyColorList::getClassTypeId() )
{
App::PropertyColorList* colors = (App::PropertyColorList*)it->second;
if ( numPoints != colors->getSize() ) {
#ifdef FC_DEBUG
SoDebugError::postWarning("ViewProviderPoints::setDisplayMode",
"The number of points (%d) doesn't match with the number of colors (%d).", numPoints, colors->getSize());
#endif
// fallback
setDisplayMaskMode("Point");
} else {
setVertexColorMode(colors);
setDisplayMaskMode("Color");
}
break;
}
}
}
else if ( strcmp("Intensity",ModeName)==0 )
{
std::map<std::string,App::Property*> Map;
pcObject->getPropertyMap(Map);
for( std::map<std::string,App::Property*>::iterator it = Map.begin(); it != Map.end(); ++it )
{
Base::Type t = it->second->getTypeId();
if ( t==Points::PropertyGreyValueList::getClassTypeId() )
{
Points::PropertyGreyValueList* greyValues = (Points::PropertyGreyValueList*)it->second;
if ( numPoints != greyValues->getSize() ) {
#ifdef FC_DEBUG
SoDebugError::postWarning("ViewProviderPoints::setDisplayMode",
"The number of points (%d) doesn't match with the number of grey values (%d).", numPoints, greyValues->getSize());
#endif
// Intensity mode is not possible then set the default () mode instead.
setDisplayMaskMode("Point");
} else {
setVertexGreyvalueMode((Points::PropertyGreyValueList*)it->second);
setDisplayMaskMode("Color");
}
break;
}
}
}
else if ( strcmp("Shaded",ModeName)==0 )
{
std::map<std::string,App::Property*> Map;
pcObject->getPropertyMap(Map);
for( std::map<std::string,App::Property*>::iterator it = Map.begin(); it != Map.end(); ++it )
{
Base::Type t = it->second->getTypeId();
if ( t==Points::PropertyNormalList::getClassTypeId() )
{
Points::PropertyNormalList* normals = (Points::PropertyNormalList*)it->second;
if ( numPoints != normals->getSize() ) {
#ifdef FC_DEBUG
SoDebugError::postWarning("ViewProviderPoints::setDisplayMode",
"The number of points (%d) doesn't match with the number of normals (%d).", numPoints, normals->getSize());
#endif
// fallback
setDisplayMaskMode("Point");
} else {
setVertexNormalMode(normals);
setDisplayMaskMode("Shaded");
}
break;
}
}
}
else if ( strcmp("Points",ModeName)==0 )
{
setDisplayMaskMode("Point");
}
ViewProviderGeometryObject::setDisplayMode(ModeName);
}
std::vector<std::string> ViewProviderPoints::getDisplayModes(void) const
{
std::vector<std::string> StrList;
StrList.push_back("Points");
if ( pcObject )
{
std::map<std::string,App::Property*> Map;
pcObject->getPropertyMap(Map);
for( std::map<std::string,App::Property*>::iterator it = Map.begin(); it != Map.end(); ++it )
{
Base::Type t = it->second->getTypeId();
if ( t==Points::PropertyNormalList::getClassTypeId() )
StrList.push_back("Shaded");
else if ( t==Points::PropertyGreyValueList::getClassTypeId() )
StrList.push_back("Intensity");
else if ( t==App::PropertyColorList::getClassTypeId() )
StrList.push_back("Color");
}
}
return StrList;
}
void ViewProviderPoints::updateData(const App::Property* prop)
{
Gui::ViewProviderGeometryObject::updateData(prop);
if (prop->getTypeId() == Points::PropertyPointKernel::getClassTypeId()) {
ViewProviderPointsBuilder builder;
builder.createPoints(prop, pcPointsCoord, pcPoints);
// The number of points might have changed, so force also a resize of the Inventor internals
setActiveMode();
}
}
QIcon ViewProviderPoints::getIcon() const
{
static const char * const Points_Feature_xpm[] = {
"16 16 4 1",
". c none",
"s c #000000",
"b c #FFFF00",
"r c #FF0000",
"ss.....ss.....bb",
"ss..ss.ss.....bb",
"....ss..........",
"...........bb...",
".ss..ss....bb...",
".ss..ss.........",
"........bb....bb",
"ss......bb....bb",
"ss..rr......bb..",
"....rr......bb..",
"........bb......",
"..rr....bb..bb..",
"..rr........bb..",
".....rr.........",
"rr...rr..rr..rr.",
"rr.......rr..rr."};
QPixmap px(Points_Feature_xpm);
return px;
}
bool ViewProviderPoints::setEdit(int)
{
return true;
}
void ViewProviderPoints::unsetEdit(int)
{
}
void ViewProviderPoints::clipPointsCallback(void * ud, SoEventCallback * n)
{
// When this callback function is invoked we must in either case leave the edit mode
Gui::View3DInventorViewer* view = reinterpret_cast<Gui::View3DInventorViewer*>(n->getUserData());
view->setEditing(false);
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), clipPointsCallback);
n->setHandled();
std::vector<SbVec2f> clPoly = view->getGLPolygon();
if (clPoly.size() < 3)
return;
if (clPoly.front() != clPoly.back())
clPoly.push_back(clPoly.front());
std::vector<Gui::ViewProvider*> views = view->getViewProvidersOfType(ViewProviderPoints::getClassTypeId());
for (std::vector<Gui::ViewProvider*>::iterator it = views.begin(); it != views.end(); ++it) {
ViewProviderPoints* that = static_cast<ViewProviderPoints*>(*it);
if (that->getEditingMode() > -1) {
that->finishEditing();
that->cut(clPoly, *view);
}
}
view->render();
}
void ViewProviderPoints::cut(const std::vector<SbVec2f>& picked, Gui::View3DInventorViewer &Viewer)
{
// create the polygon from the picked points
Base::Polygon2D cPoly;
for (std::vector<SbVec2f>::const_iterator it = picked.begin(); it != picked.end(); ++it) {
cPoly.Add(Base::Vector2D((*it)[0],(*it)[1]));
}
// get a reference to the point feature
Points::Feature* fea = (Points::Feature*)pcObject;
const Points::PointKernel& points = fea->Points.getValue();
SoCamera* pCam = Viewer.getCamera();
SbViewVolume vol = pCam->getViewVolume();
// search for all points inside/outside the polygon
Points::PointKernel newKernel;
for ( Points::PointKernel::const_iterator jt = points.begin(); jt != points.end(); ++jt ) {
SbVec3f pt(jt->x,jt->y,jt->z);
// project from 3d to 2d
vol.projectToScreen(pt, pt);
if (!cPoly.Contains(Base::Vector2D(pt[0],pt[1])))
newKernel.push_back(*jt);
}
if (newKernel.size() == points.size())
return; // nothing needs to be done
//Remove the points from the cloud and open a transaction object for the undo/redo stuff
Gui::Application::Instance->activeDocument()->openCommand("Cut points");
// sets the points outside the polygon to update the Inventor node
fea->Points.setValue(newKernel);
// unset the modified flag because we don't need the features' execute() to be called
Gui::Application::Instance->activeDocument()->commitCommand();
fea->purgeTouched();
}
// -------------------------------------------------
namespace Gui {
/// @cond DOXERR
PROPERTY_SOURCE_TEMPLATE(PointsGui::ViewProviderPython, PointsGui::ViewProviderPoints)
/// @endcond
// explicit template instantiation
template class PointsGuiExport ViewProviderPythonFeatureT<PointsGui::ViewProviderPoints>;
}
// -------------------------------------------------
void ViewProviderPointsBuilder::buildNodes(const App::Property* prop, std::vector<SoNode*>& nodes) const
{
SoCoordinate3 *pcPointsCoord=0;
SoPointSet *pcPoints=0;
if (nodes.empty()) {
pcPointsCoord = new SoCoordinate3();
nodes.push_back(pcPointsCoord);
pcPoints = new SoPointSet();
nodes.push_back(pcPoints);
}
else if (nodes.size() == 2) {
if (nodes[0]->getTypeId() == SoCoordinate3::getClassTypeId())
pcPointsCoord = static_cast<SoCoordinate3*>(nodes[0]);
if (nodes[1]->getTypeId() == SoPointSet::getClassTypeId())
pcPoints = static_cast<SoPointSet*>(nodes[1]);
}
if (pcPointsCoord && pcPoints)
createPoints(prop, pcPointsCoord, pcPoints);
}
void ViewProviderPointsBuilder::createPoints(const App::Property* prop, SoCoordinate3* coords, SoPointSet* points) const
{
const Points::PropertyPointKernel* prop_points = static_cast<const Points::PropertyPointKernel*>(prop);
const Points::PointKernel& cPts = prop_points->getValue();
// disable the notification, otherwise whenever a point is inserted SoPointSet gets notified
coords->enableNotify(false);
coords->point.deleteValues(0);
coords->point.setNum(cPts.size());
// get all points
int idx=0;
const std::vector<Base::Vector3f>& kernel = cPts.getBasicPoints();
for (std::vector<Base::Vector3f>::const_iterator it = kernel.begin(); it != kernel.end(); ++it, idx++) {
coords->point.set1Value(idx, it->x, it->y, it->z);
}
points->numPoints = cPts.size();
coords->enableNotify(true);
coords->touch();
}

View File

@@ -0,0 +1,126 @@
/***************************************************************************
* Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.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 POINTSGUI_VIEWPROVIDERPOINTS_H
#define POINTSGUI_VIEWPROVIDERPOINTS_H
#include <Base/Vector3D.h>
#include <Gui/ViewProviderGeometryObject.h>
#include <Gui/ViewProviderPythonFeature.h>
#include <Gui/ViewProviderBuilder.h>
#include <Inventor/SbVec2f.h>
class SoSwitch;
class SoPointSet;
class SoLocateHighlight;
class SoCoordinate3;
class SoNormal;
class SoEventCallback;
namespace App {
class PropertyColorList;
}
namespace Gui {
class SoFCSelection;
}
namespace Points {
class PropertyGreyValueList;
class PropertyNormalList;
class PointKernel;
class Feature;
}
namespace PointsGui {
class ViewProviderPointsBuilder : public Gui::ViewProviderBuilder
{
public:
ViewProviderPointsBuilder(){}
~ViewProviderPointsBuilder(){}
virtual void buildNodes(const App::Property*, std::vector<SoNode*>&) const;
void createPoints(const App::Property*, SoCoordinate3*, SoPointSet*) const;
};
/**
* The ViewProviderPoints class creates
* a node representing the point data structure.
* @author Werner Mayer
*/
class PointsGuiExport ViewProviderPoints : public Gui::ViewProviderGeometryObject
{
PROPERTY_HEADER(PointsGui::ViewProviderPoints);
public:
ViewProviderPoints();
virtual ~ViewProviderPoints();
App::PropertyFloatConstraint PointSize;
/**
* Extracts the point data from the feature \a pcFeature and creates
* an Inventor node \a SoNode with these data.
*/
virtual void attach(App::DocumentObject *);
/// set the viewing mode
virtual void setDisplayMode(const char* ModeName);
/// returns a list of all possible modes
virtual std::vector<std::string> getDisplayModes(void) const;
/// Update the point representation
virtual void updateData(const App::Property*);
virtual QIcon getIcon() const;
/// Sets the edit mnode
bool setEdit(int ModNum);
/// Unsets the edit mode
void unsetEdit(int ModNum);
public:
static void clipPointsCallback(void * ud, SoEventCallback * n);
protected:
void onChanged(const App::Property* prop);
void setVertexColorMode(App::PropertyColorList*);
void setVertexGreyvalueMode(Points::PropertyGreyValueList*);
void setVertexNormalMode(Points::PropertyNormalList*);
virtual void cut( const std::vector<SbVec2f>& picked, Gui::View3DInventorViewer &Viewer);
protected:
SoCoordinate3 *pcPointsCoord;
SoPointSet *pcPoints;
SoMaterial *pcColorMat;
SoNormal *pcPointsNormal;
SoDrawStyle *pcPointStyle;
private:
static App::PropertyFloatConstraint::Constraints floatRange;
};
typedef Gui::ViewProviderPythonFeatureT<ViewProviderPoints> ViewProviderPython;
} // namespace PointsGui
#endif // POINTSGUI_VIEWPROVIDERPOINTS_H

View File

@@ -0,0 +1,86 @@
/***************************************************************************
* Copyright (c) 2005 Werner Mayer <wmayer[at]users.sourceforge.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 <qobject.h>
#endif
#include "Workbench.h"
#include <Gui/ToolBarManager.h>
#include <Gui/MenuManager.h>
using namespace PointsGui;
#if 0 // needed for Qt's lupdate utility
qApp->translate("Workbench", "Points tools");
qApp->translate("Workbench", "&Points");
#endif
/// @namespace PointsGui @class Workbench
TYPESYSTEM_SOURCE(PointsGui::Workbench, Gui::StdWorkbench)
Workbench::Workbench()
{
}
Workbench::~Workbench()
{
}
Gui::ToolBarItem* Workbench::setupToolBars() const
{
Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
Gui::ToolBarItem* pnt = new Gui::ToolBarItem( root );
pnt->setCommand("Points tools");
*pnt << "Points_Import" << "Points_Export" << "Separator" << "Points_PolyCut";
return root;
}
Gui::ToolBarItem* Workbench::setupCommandBars() const
{
// point tools
Gui::ToolBarItem* root = new Gui::ToolBarItem;
Gui::ToolBarItem* pnt = new Gui::ToolBarItem( root );
pnt->setCommand("Points tools");
*pnt << "Points_Import" << "Points_Export";
return root;
}
Gui::MenuItem* Workbench::setupMenuBar() const
{
Gui::MenuItem* root = StdWorkbench::setupMenuBar();
Gui::MenuItem* item = root->findItem("&Windows");
Gui::MenuItem* pnts = new Gui::MenuItem;
root->insertItem(item, pnts);
Gui::MenuItem* test = new Gui::MenuItem;
test->setCommand("Test");
*test << "Points_Transform";
pnts->setCommand("&Points");
*pnts << test << "Separator" << "Points_Import" << "Points_Export" << "Separator" << "Points_PolyCut";
return root;
}

View File

@@ -0,0 +1,51 @@
/***************************************************************************
* Copyright (c) 2005 Werner Mayer <wmayer[at]users.sourceforge.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 POINTS_WORKBENCH_H
#define POINTS_WORKBENCH_H
#include <Gui/Workbench.h>
namespace PointsGui {
/**
* @author Werner Mayer
*/
class PointsGuiExport Workbench : public Gui::StdWorkbench
{
TYPESYSTEM_HEADER();
public:
Workbench();
virtual ~Workbench();
protected:
Gui::ToolBarItem* setupToolBars() const;
Gui::ToolBarItem* setupCommandBars() const;
Gui::MenuItem* setupMenuBar() const;
};
} // namespace PointsGui
#endif // POINTS_WORKBENCH_H

40
src/Mod/Points/Init.py Normal file
View File

@@ -0,0 +1,40 @@
# FreeCAD init script of the Points module
# (c) 2005 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2005 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD 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 Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
# Get the Parameter Group of this module
ParGrp = App.ParamGet("System parameter:Modules").GetGroup("Points")
# Set the needed information
ParGrp.SetString("WorkBenchName", "Points Design")
# Append the open handler
FreeCAD.EndingAdd("Point formats (*.asc)","Points")

68
src/Mod/Points/InitGui.py Normal file
View File

@@ -0,0 +1,68 @@
# Points gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU General Public License (GPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD 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 FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
class PointsWorkbench ( Workbench ):
"Points workbench object"
Icon = """
/* XPM */
static const char *test_icon[]={
"16 16 2 1",
"a c #000000",
". c None",
"......##......##",
"............##..",
"..##....##......",
"......##.....##.",
"....##....##....",
"##..............",
"....##....##....",
".......##.......",
"...##......##...",
".....##.........",
".........##.....",
"...##........##.",
".....##.........",
".........##.....",
"...##......##...",
"................"};
"""
MenuText = "Points"
ToolTip = "Points workbench"
def Initialize(self):
# load the module
import PointsGui
def GetClassName(self):
return "PointsGui::Workbench"
Gui.addWorkbench(PointsWorkbench())

View File

@@ -0,0 +1,11 @@
SUBDIRS=App Gui
# Change data dir from default ($(prefix)/share) to $(prefix)
datadir = $(prefix)/Mod/Points
data_DATA = Init.py InitGui.py
EXTRA_DIST = \
$(data_DATA) \
CMakeLists.txt \
points.dox

View File

@@ -0,0 +1,3 @@
/** \defgroup POINTS Points
* \ingroup WORKBENCHES */