#include <Points.h>
Classes | |
class | const_point_iterator |
Public Types | |
typedef std::vector< value_type >::difference_type | difference_type |
typedef float | float_type |
typedef std::vector< value_type >::size_type | size_type |
typedef Base::Vector3< float_type > | value_type |
Public Member Functions | |
void | operator= (const PointKernel &) |
PointKernel () | |
PointKernel (const PointKernel &) | |
PointKernel (size_type size) | |
virtual | ~PointKernel () |
Subelement management | |
virtual std::vector< const char * > | getElementTypes () const |
Sub type list List of different subelement types its NOT a list of the subelements itself. More... | |
virtual unsigned long | countSubElements (const char *Type) const |
virtual Data::Segment * | getSubElement (const char *Type, unsigned long) const |
get the subelement by type and number More... | |
void | setTransform (const Base::Matrix4D &rclTrf) |
Override the current transformation with the new one. More... | |
Base::Matrix4D | getTransform () const |
Return the current matrix This method has to be handled by the child classes. More... | |
std::vector< value_type > & | getBasicPoints () |
const std::vector< value_type > & | getBasicPoints () const |
void | setBasicPoints (const std::vector< value_type > &pts) |
void | swap (std::vector< value_type > &pts) |
virtual void | getPoints (std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &Normals, float Accuracy, uint16_t flags=0) const |
Get points from object with given accuracy. More... | |
virtual void | transformGeometry (const Base::Matrix4D &rclMat) |
Applies a transformation on the real geometric data type. More... | |
virtual Base::BoundBox3d | getBoundBox () const |
Get the bound box. More... | |
Iterator | |
const_point_iterator | begin () const |
const_point_iterator | end () const |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
Public Member Functions inherited from Data::ComplexGeoData | |
ComplexGeoData () | |
Constructor. More... | |
virtual | ~ComplexGeoData () |
Destructor. More... | |
virtual Segment * | getSubElementByName (const char *Name) const |
get subelement by combined name More... | |
virtual void | getLinesFromSubElement (const Segment *, std::vector< Base::Vector3d > &Points, std::vector< Line > &lines) const |
Get lines from segment. More... | |
virtual void | getFacesFromSubElement (const Segment *, std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &PointNormals, std::vector< Facet > &faces) const |
Get faces from segment. More... | |
void | applyTransform (const Base::Matrix4D &rclTrf) |
Applies an additional transformation to the current transformation. More... | |
void | applyTranslation (const Base::Vector3d &) |
Applies an additional translation to the current transformation. More... | |
void | applyRotation (const Base::Rotation &) |
Applies an additional rotation to the current transformation. More... | |
void | setPlacement (const Base::Placement &rclPlacement) |
Override the current transformation with a placement using the setTransform() method. More... | |
Base::Placement | getPlacement () const |
Return the current transformation as placement using getTransform(). More... | |
virtual Base::Vector3d | getPointFromLineIntersection (const Base::Vector3f &base, const Base::Vector3f &dir) const |
Get point from line object intersection More... | |
virtual void | getLines (std::vector< Base::Vector3d > &Points, std::vector< Line > &lines, float Accuracy, uint16_t flags=0) const |
Get lines from object with given accuracy. More... | |
virtual void | getFaces (std::vector< Base::Vector3d > &Points, std::vector< Facet > &faces, float Accuracy, uint16_t flags=0) const |
Get faces from object with given accuracy. More... | |
virtual bool | getCenterOfGravity (Base::Vector3d ¢er) const |
Get the center of gravity If this method is implemented then true is returned and the center of gravity. More... | |
Public Member Functions inherited from Base::Persistence | |
void | dumpToStream (std::ostream &stream, int compression) |
virtual unsigned int | getMemSize () const =0 |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
virtual Base::Type | getTypeId (void) const |
virtual void | Restore (XMLReader &)=0 |
This method is used to restore properties from an XML document. More... | |
virtual void | RestoreDocFile (Reader &) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void | restoreFromStream (std::istream &stream) |
virtual void | Save (Writer &) const =0 |
This method is used to save properties to an XML document. More... | |
virtual void | SaveDocFile (Writer &) const |
This method is used to save large amounts of data to a binary file. More... | |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
BaseClass (const BaseClass &)=default | |
virtual PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
virtual Type | getTypeId () const |
bool | isDerivedFrom (const Type type) const |
BaseClass & | operator= (const BaseClass &)=default |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Public Member Functions inherited from Base::Handled | |
int | getRefCount () const |
Handled () | |
const Handled & | operator= (const Handled &) |
void | ref () const |
void | unref () const |
virtual | ~Handled () |
I/O | |
typedef const_point_iterator | const_iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
unsigned int | getMemSize () const |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? More... | |
void | Save (Base::Writer &writer) const |
This method is used to save properties to an XML document. More... | |
void | SaveDocFile (Base::Writer &writer) const |
This method is used to save large amounts of data to a binary file. More... | |
void | Restore (Base::XMLReader &reader) |
This method is used to restore properties from an XML document. More... | |
void | RestoreDocFile (Base::Reader &reader) |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More... | |
void | save (const char *file) const |
void | save (std::ostream &) const |
void | load (const char *file) |
void | load (std::istream &) |
size_type | size () const |
number of points stored More... | |
size_type | countValid () const |
std::vector< value_type > | getValidPoints () const |
void | resize (size_type n) |
void | reserve (size_type n) |
void | erase (size_type first, size_type last) |
void | clear () |
const Base::Vector3d | getPoint (const int idx) const |
get the points More... | |
void | setPoint (const int idx, const Base::Vector3d &point) |
set the points More... | |
void | push_back (const Base::Vector3d &point) |
insert the points More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Data::ComplexGeoData | |
static const std::string & | elementMapPrefix () |
Special prefix to mark the beginning of a mapped sub-element name. More... | |
static const std::string & | tagPostfix () |
Special postfix to mark the following tag. More... | |
static const std::string & | indexPostfix () |
Special postfix to mark the index of an array element. More... | |
static const std::string & | missingPrefix () |
Special prefix to mark a missing element. More... | |
static bool | hasMissingElement (const char *subname) |
Check if a subname contains missing element. More... | |
static const char * | isMappedElement (const char *name) |
Check if the name starts with elementMapPrefix() More... | |
static std::string | newElementName (const char *name) |
Strip out the trailing element name if there is mapped element name precedes it. More... | |
static std::string | oldElementName (const char *name) |
Strip out the mapped element name if there is one. More... | |
static std::string | noElementName (const char *name) |
Strip out the old and new element name if there is one. More... | |
static const char * | findElementName (const char *subname) |
Find the start of an element name in a subname. More... | |
static const char * | hasMappedElementName (const char *subname) |
Static Public Member Functions inherited from Base::Persistence | |
static void * | create (void) |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. More... | |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create () |
static Type | getClassTypeId () |
static void | init () |
Public Attributes inherited from Data::ComplexGeoData | |
long | Tag |
Protected Member Functions inherited from Data::ComplexGeoData | |
Base::Vector3d | transformToOutside (const Base::Vector3f &vec) const |
from local to outside More... | |
Base::Vector3f | transformToInside (const Base::Vector3d &vec) const |
from local to inside More... | |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
Point kernel.
typedef std::reverse_iterator<const_iterator> Points::PointKernel::const_reverse_iterator |
typedef std::vector<value_type>::difference_type Points::PointKernel::difference_type |
typedef float Points::PointKernel::float_type |
typedef std::vector<value_type>::size_type Points::PointKernel::size_type |
Points::PointKernel::PointKernel | ( | ) |
Points::PointKernel::PointKernel | ( | size_type | size | ) |
PointKernel::PointKernel | ( | const PointKernel & | pts | ) |
|
virtual |
const_point_iterator Points::PointKernel::begin | ( | ) | const |
Referenced by countValid(), getBoundBox(), and getValidPoints().
void Points::PointKernel::clear | ( | void | ) |
Referenced by Restore().
|
virtual |
Implements Data::ComplexGeoData.
PointKernel::size_type PointKernel::countValid | ( | ) | const |
References begin(), and end().
Referenced by getValidPoints().
const_point_iterator Points::PointKernel::end | ( | ) | const |
Referenced by Dice3DS.dom3ds.FileLikeBuffer::advance(), Points::PointKernel::const_point_iterator::const_point_iterator(), countValid(), getBoundBox(), getValidPoints(), Dice3DS.dom3ds.FileLikeBuffer::read_rest(), Dice3DS.dom3ds.FileLikeBuffer::read_to_nul(), Dice3DS.dom3ds.FileLikeBuffer::room_for_chunks(), and Dice3DS.dom3ds.FileLikeBuffer::seek().
std::vector< value_type > & Points::PointKernel::getBasicPoints | ( | ) |
Referenced by PointsGui::ViewProviderPointsBuilder::createPoints(), and transformGeometry().
const std::vector< value_type > & Points::PointKernel::getBasicPoints | ( | ) | const |
|
virtual |
Get the bound box.
Implements Data::ComplexGeoData.
References Base::BoundBox3< _Precision >::Add(), begin(), and end().
|
virtual |
Sub type list List of different subelement types its NOT a list of the subelements itself.
Implements Data::ComplexGeoData.
|
virtual |
This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
Implements Base::Persistence.
const Base::Vector3d Points::PointKernel::getPoint | ( | const int | idx | ) | const |
get the points
Referenced by ArchStructure.CommandStructuralSystem::Activated(), PathScripts.PathOpGui.TaskPanelBaseLocationPage::addLocation(), PathScripts.PathDressupTagGui.PathDressupTagTaskPanel::addNewTag(), PathScripts.PathOpGui.TaskPanelBaseLocationPage::editLocation(), PathScripts.PathDressupTagGui.PathDressupTagTaskPanel::editTag(), draftguitools.gui_arcs.Arc_3Points::getPoint(), ArchCurtainWall.CommandArchCurtainWall::getPoint(), ArchTruss.CommandArchTruss::getPoint(), getPoints(), PathScripts.PathDressupTagGui.PathDressupTagTaskPanel::modifyStandardButtons(), and PathScripts.PathOpGui.TaskPanelBaseLocationPage::modifyStandardButtons().
|
virtual |
Get points from object with given accuracy.
Reimplemented from Data::ComplexGeoData.
References getPoint().
|
virtual |
get the subelement by type and number
Implements Data::ComplexGeoData.
|
virtual |
Return the current matrix This method has to be handled by the child classes.
the actual placement and matrix is not part of this class.
Implements Data::ComplexGeoData.
std::vector< PointKernel::value_type > PointKernel::getValidPoints | ( | ) | const |
References begin(), countValid(), and end().
void PointKernel::load | ( | const char * | file | ) |
void Points::PointKernel::load | ( | std::istream & | ) |
void PointKernel::operator= | ( | const PointKernel & | Kernel | ) |
References setTransform().
void Points::PointKernel::push_back | ( | const Base::Vector3d & | point | ) |
insert the points
Referenced by PointsGui::ViewProviderStructured::cut(), and Points::PropertyPointKernel::removeIndices().
const_reverse_iterator Points::PointKernel::rbegin | ( | ) | const |
const_reverse_iterator Points::PointKernel::rend | ( | ) | const |
void Points::PointKernel::reserve | ( | size_type | n | ) |
Referenced by PointsGui::ViewProviderStructured::cut(), and Points::PropertyPointKernel::removeIndices().
void Points::PointKernel::resize | ( | size_type | n | ) |
|
virtual |
This method is used to restore properties from an XML document.
It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:
Implements Base::Persistence.
References Base::XMLReader::addFile(), clear(), Base::XMLReader::DocumentSchema, Base::XMLReader::getAttribute(), and Base::XMLReader::readElement().
|
virtual |
This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data.
Again you have to apply for the call of this method in the Restore() call:
After you issued the reader.addFile() your RestoreDocFile() is called:
Reimplemented from Base::Persistence.
|
virtual |
This method is used to save properties to an XML document.
A good example you'll find in PropertyStandard.cpp, e.g. the vector:
The writer.ind() expression writes the indentation, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.
Implements Base::Persistence.
References Base::Writer::addFile(), Base::Writer::ind(), Base::Writer::isForceXML(), Base::Writer::ObjectName, and Base::Writer::Stream().
void PointKernel::save | ( | const char * | file | ) | const |
void PointKernel::save | ( | std::ostream & | out | ) | const |
|
virtual |
This method is used to save large amounts of data to a binary file.
Sometimes it makes no sense to write property data as XML. In case the amount of data is too big or the data type has a more effective way to save itself. In this cases it is possible to write the data in a separate file inside the document archive. In case you want do so you have to re-implement SaveDocFile(). First, you have to inform the framework in Save() that you want do so. Here an example from the Mesh module which can save a (pontetionaly big) triangle mesh:
The writer.isForceXML() is an indication to force you to write XML. Regardless of size and effectiveness. The second part informs the Base::writer through writer.addFile("MeshKernel.bms", this) that this object wants to write a file with the given name. The method addFile() returns a unique name that then is written in the XML stream. This allows your RestoreDocFile() method to identify and read the file again. Later your SaveDocFile() method is called as many times as you issued the addFile() call:
In this method you can simply stream your content to the file (Base::Writer inheriting from ostream).
Reimplemented from Base::Persistence.
References size(), and Base::Writer::Stream().
void Points::PointKernel::setBasicPoints | ( | const std::vector< value_type > & | pts | ) |
void Points::PointKernel::setPoint | ( | const int | idx, |
const Base::Vector3d & | point | ||
) |
set the points
Referenced by drafttaskpanels.task_shapestring.ShapeStringTaskPanel::action(), and drafttaskpanels.task_shapestring.ShapeStringTaskPanel::resetPoint().
|
virtual |
Override the current transformation with the new one.
This method has to be handled by the child classes. the actual placement and matrix is not part of this class.
Implements Data::ComplexGeoData.
Referenced by operator=(), and Points::PropertyPointKernel::removeIndices().
size_type Points::PointKernel::size | ( | void | ) | const |
number of points stored
Referenced by gzip_utf8.GzipFile::close(), PointsGui::ViewProviderPointsBuilder::createPoints(), PathScripts.PostUtils.GCodeEditorDialog::done(), SaveDocFile(), Points::PointsGrid::Validate(), and gzip_utf8.GzipFile::write().
void Points::PointKernel::swap | ( | std::vector< value_type > & | pts | ) |
|
virtual |
Applies a transformation on the real geometric data type.
Implements Data::ComplexGeoData.
References getBasicPoints(), and Base::Matrix4D::multVec().