SpecularPoints is a class that mirrors a point cloud w.r.t. a reference plane, on a target surface geometry if any. More...

#include <SpecularPoints.hpp>

Inheritance diagram for mimmo::SpecularPoints:
Collaboration diagram for mimmo::SpecularPoints:

Public Member Functions

 SpecularPoints ()
 
 SpecularPoints (const bitpit::Config::Section &rootXML)
 
 SpecularPoints (const SpecularPoints &other)
 
 ~SpecularPoints ()
 
virtual void absorbSectionXML (const bitpit::Config::Section &slotXML, std::string name="")
 
void buildPorts ()
 
void clear ()
 
void execute ()
 
virtual void flushSectionXML (bitpit::Config::Section &slotXML, std::string name="")
 
livector1D getMirroredLabels ()
 
MimmoSharedPointer< MimmoObjectgetMirroredPointCloud ()
 
dvecarr3E getMirroredRawCoords ()
 
dmpvector1DgetMirroredScalarData ()
 
dmpvecarr3EgetMirroredVectorData ()
 
dmpvector1DgetOriginalScalarData ()
 
dmpvecarr3EgetOriginalVectorData ()
 
darray4E getPlane ()
 
bool isForced ()
 
bool isInsideOut ()
 
SpecularPointsoperator= (SpecularPoints other)
 
void setForce (bool flag)
 
void setInsideOut (bool flag)
 
void setNormal (darray3E normal)
 
void setOrigin (darray3E origin)
 
void setPlane (darray3E origin, darray3E normal)
 
void setPlane (darray4E plane)
 
void setPointCloud (MimmoSharedPointer< MimmoObject > targetpatch)
 
void setScalarData (dmpvector1D *data)
 
void setVectorData (dmpvecarr3E *vdata)
 
- Public Member Functions inherited from mimmo::ProjPatchOnSurface
 ProjPatchOnSurface ()
 
 ProjPatchOnSurface (const bitpit::Config::Section &rootXML)
 
 ProjPatchOnSurface (const ProjPatchOnSurface &other)
 
virtual ~ProjPatchOnSurface ()
 
void clear ()
 
bool isWorkingOnTarget ()
 
ProjPatchOnSurfaceoperator= (ProjPatchOnSurface other)
 
void setPatch (MimmoSharedPointer< MimmoObject > geo)
 
void setWorkingOnTarget (bool)
 
- Public Member Functions inherited from mimmo::ProjPrimitivesOnSurfaces
 ProjPrimitivesOnSurfaces ()
 
 ProjPrimitivesOnSurfaces (const ProjPrimitivesOnSurfaces &other)
 
virtual ~ProjPrimitivesOnSurfaces ()
 
void clear ()
 
MimmoSharedPointer< MimmoObjectgetProjectedElement ()
 
int getTopology ()
 
bool isEmpty ()
 
ProjPrimitivesOnSurfacesoperator= (const ProjPrimitivesOnSurfaces &other)
 
void setBuildKdTree (bool build)
 
void setBuildSkdTree (bool build)
 
void setGeometry (MimmoSharedPointer< MimmoObject > geo)
 
void setProjElementTargetNCells (int nC)
 
- Public Member Functions inherited from mimmo::BaseManipulation
 BaseManipulation ()
 
 BaseManipulation (const BaseManipulation &other)
 
virtual ~BaseManipulation ()
 
void activate ()
 
bool arePortsBuilt ()
 
void clear ()
 
void disable ()
 
void exec ()
 
BaseManipulationgetChild (int i=0)
 
ConnectionType getConnectionType ()
 
MimmoSharedPointer< MimmoObjectgetGeometry ()
 
MimmoSharedPointer< MimmoObject > & getGeometryReference ()
 
int getId ()
 
bitpit::Logger & getLog ()
 
std::string getName ()
 
int getNChild ()
 
int getNParent ()
 
int getNPortsIn ()
 
int getNPortsOut ()
 
BaseManipulationgetParent (int i=0)
 
std::unordered_map< PortID, PortIn * > getPortsIn ()
 
std::unordered_map< PortID, PortOut * > getPortsOut ()
 
uint getPriority ()
 
virtual std::vector< BaseManipulation * > getSubBlocksEmbedded ()
 
bool isActive ()
 
bool isApply ()
 
bool isChild (BaseManipulation *, int &)
 
bool isParent (BaseManipulation *, int &)
 
bool isPlotInExecution ()
 
BaseManipulationoperator= (const BaseManipulation &other)
 
void removePins ()
 
void removePinsIn ()
 
void removePinsOut ()
 
void setApply (bool flag=true)
 
void setGeometry (MimmoSharedPointer< MimmoObject > geometry)
 
void setId (int)
 
void setLog (bitpit::Logger &log)
 
void setName (std::string name)
 
void setOutputPlot (std::string path)
 
void setPlotInExecution (bool)
 
void setPriority (uint priority)
 
void unsetGeometry ()
 

Protected Member Functions

virtual void plotOptionalResults ()
 
void swap (SpecularPoints &x) noexcept
 
- Protected Member Functions inherited from mimmo::ProjPatchOnSurface
void projection ()
 
void swap (ProjPatchOnSurface &x) noexcept
 
- Protected Member Functions inherited from mimmo::ProjPrimitivesOnSurfaces
void swap (ProjPrimitivesOnSurfaces &x) noexcept
 
- Protected Member Functions inherited from mimmo::BaseManipulation
void _apply (MimmoPiercedVector< darray3E > &displacements)
 
void addChild (BaseManipulation *child)
 
void addParent (BaseManipulation *parent)
 
void addPinIn (BaseManipulation *objIn, PortID portR)
 
void addPinOut (BaseManipulation *objOut, PortID portS, PortID portR)
 
virtual void apply ()
 
void cleanBufferIn (PortID port)
 
template<typename T , typename O >
bool createPortIn (O *obj, void(O::*setVar_)(T), PortID portR, bool mandatory=false, int family=0)
 
template<typename T , typename O >
bool createPortIn (T *var_, PortID portR, bool mandatory=false, int family=0)
 
template<typename T , typename O >
bool createPortOut (O *obj, T(O::*getVar_)(), PortID portS)
 
template<typename T , typename O >
bool createPortOut (T *var_, PortID portS)
 
void deletePorts ()
 
PortID findPinIn (PortIn &pin)
 
PortID findPinOut (PortOut &pin)
 
void initializeLogger (bool logexists)
 
void readBufferIn (PortID port)
 
void removePinIn (BaseManipulation *objIn, PortID portR)
 
void removePinIn (PortID portR, int j)
 
void removePinOut (BaseManipulation *objOut, PortID portS)
 
void removePinOut (PortID portS, int j)
 
void setBufferIn (PortID port, mimmo::IBinaryStream &input)
 
void swap (BaseManipulation &x) noexcept
 
void unsetChild (BaseManipulation *child)
 
void unsetParent (BaseManipulation *parent)
 
void write (MimmoSharedPointer< MimmoObject > geometry)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, MimmoPiercedVector< mpv_t > &data, Args ... args)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t > * > &data, Args ... args)
 
template<typename mpv_t >
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data)
 
template<typename mpv_t , typename... Args>
void write (MimmoSharedPointer< MimmoObject > geometry, std::vector< MimmoPiercedVector< mpv_t >> &data, Args ... args)
 

Additional Inherited Members

- Public Types inherited from mimmo::BaseManipulation
typedef std::unordered_map< BaseManipulation *, int > bmumap
 
typedef pin::ConnectionType ConnectionType
 
typedef std::string PortID
 
- Protected Attributes inherited from mimmo::ProjPatchOnSurface
MimmoSharedPointer< MimmoObjectm_cobj
 
bool m_workingOnTarget
 
- Protected Attributes inherited from mimmo::ProjPrimitivesOnSurfaces
bool m_buildKdTree
 
bool m_buildSkdTree
 
int m_nC
 
MimmoSharedPointer< MimmoObjectm_patch
 
int m_topo
 
- Protected Attributes inherited from mimmo::BaseManipulation
bool m_active
 
bool m_apply
 
bool m_arePortsBuilt
 
bmumap m_child
 
int m_counter
 
bool m_execPlot
 
MimmoSharedPointer< MimmoObjectm_geometry
 
bitpit::Logger * m_log
 
std::string m_name
 
std::string m_outputPlot
 
bmumap m_parent
 
std::unordered_map< PortID, PortIn * > m_portIn
 
std::unordered_map< PortID, PortOut * > m_portOut
 
ConnectionType m_portsType
 
uint m_priority
 
- Static Protected Attributes inherited from mimmo::BaseManipulation
static int sm_baseManipulationCounter
 

Detailed Description

SpecularPoints is a class that mirrors a point cloud w.r.t. a reference plane, on a target surface geometry if any.

SpecularPoints is a custom derivation of ProjPatchOnSurface class, specialized for Point Clouds. Given a point cloud and a reference plane, the class mirrors such points with respect to this plane. If a surface geometry is linked, it projects the final mirrored points on it.
Any data attached, as scalar/vector float data format, are mirrored as well.

Ports available in SpecularPoints Class :


Port Input
PortType variable/function DataType
M_GEOM2 setPointCloud (MC_SCALAR, MD_MIMMO_)
M_GEOM setGeometry (MC_SCALAR, MD_MIMMO_)
M_VECTORFIELD setVectorData (MC_SCALAR, MD_MPVECARR3FLOAT_)
M_SCALARFIELD setScalarData (MC_SCALAR, MD_MPVECFLOAT_)
M_PLANE setPlane (MC_ARRAY4, MD_FLOAT)
M_POINT setOrigin (MC_ARRAY3, MD_FLOAT)
M_AXIS setNormal (MC_ARRAY3, MD_FLOAT)
Port Output
PortType variable/function DataType
M_VECTORFIELD getMirroredVectorData (MC_SCALAR, MD_MPVECARR3FLOAT_)
M_SCALARFIELD getMirroredScalarData (MC_SCALAR, MD_MPVECFLOAT_)
M_GEOM getMirroredPointCloud (MC_SCALAR, MD_MIMMO_)


The xml available parameters, sections and subsections are the following :

Inherited from BaseManipulation:

  • ClassName: name of the class as mimmo.SpecularPoints;
  • Priority: uint marking priority in multi-chain execution;
  • PlotInExecution: boolean 0/1 print optional results of the class;
  • OutputPlot: target directory for optional results writing.

Inherited from ProjPatchOnSurface:

  • KdTree : evaluate kdTree true 1/false 0 for final Point Cloud;

Proper of the class:

  • Force: boolean 0/1. If true, force mirroring of points that lies on the plane;
  • InsideOut: boolean 0/1 to align/reverse mirroring with/against the plane normal;
  • Plane: section defining the plane's normal and a point belonging to it :

    <Plane>
       <Point> 0.0 0.0 0.0 </Point>
       <Normal> 0.0 1.0 0.0 </Normal>
    </Plane>


    Points list and data have to be mandatorily passed through port.
Examples
utils_example_00003.cpp.

Definition at line 91 of file SpecularPoints.hpp.

Constructor & Destructor Documentation

◆ SpecularPoints() [1/3]

mimmo::SpecularPoints::SpecularPoints ( )

Default constructor of SpecularPoints

Definition at line 32 of file SpecularPoints.cpp.

◆ SpecularPoints() [2/3]

mimmo::SpecularPoints::SpecularPoints ( const bitpit::Config::Section &  rootXML)

Custom constructor reading xml data

Parameters
[in]rootXMLreference to your xml tree section

Definition at line 48 of file SpecularPoints.cpp.

◆ ~SpecularPoints()

mimmo::SpecularPoints::~SpecularPoints ( )

Default destructor of SpecularPoints

Definition at line 72 of file SpecularPoints.cpp.

◆ SpecularPoints() [3/3]

mimmo::SpecularPoints::SpecularPoints ( const SpecularPoints other)

Copy constructor of SpecularPoints. No result are copied.

Definition at line 76 of file SpecularPoints.cpp.

Member Function Documentation

◆ absorbSectionXML()

void mimmo::SpecularPoints::absorbSectionXML ( const bitpit::Config::Section &  slotXML,
std::string  name = "" 
)
virtual

It sets infos reading from a XML bitpit::Config::section.

Parameters
[in]slotXMLbitpit::Config::Section of XML file
[in]namename associated to the slot

Reimplemented from mimmo::ProjPatchOnSurface.

Definition at line 554 of file SpecularPoints.cpp.

◆ buildPorts()

void mimmo::SpecularPoints::buildPorts ( )
virtual

It builds the input/output ports of the object

Reimplemented from mimmo::ProjPatchOnSurface.

Definition at line 119 of file SpecularPoints.cpp.

◆ clear()

void mimmo::SpecularPoints::clear ( )

Clear all content of the class

Definition at line 538 of file SpecularPoints.cpp.

◆ execute()

void mimmo::SpecularPoints::execute ( )
virtual

Execution command.Mirror the list of points linked, with data attached if any. If a geometry is linked, project all resulting points on it.

Reimplemented from mimmo::ProjPrimitivesOnSurfaces.

Definition at line 355 of file SpecularPoints.cpp.

◆ flushSectionXML()

void mimmo::SpecularPoints::flushSectionXML ( bitpit::Config::Section &  slotXML,
std::string  name = "" 
)
virtual

It sets infos from class members in a XML bitpit::Config::section.

Parameters
[in]slotXMLbitpit::Config::Section of XML file
[in]namename associated to the slot

Reimplemented from mimmo::ProjPatchOnSurface.

Definition at line 613 of file SpecularPoints.cpp.

◆ getMirroredLabels()

livector1D mimmo::SpecularPoints::getMirroredLabels ( )

It gets the labels associated to the list of getMirroredRawCoords. Meaningful after execution.

Returns
labels of mirrored raw point cloud coordinates.

Definition at line 195 of file SpecularPoints.cpp.

◆ getMirroredPointCloud()

MimmoSharedPointer< MimmoObject > mimmo::SpecularPoints::getMirroredPointCloud ( )
Returns
final mirrored point cloud.

Definition at line 211 of file SpecularPoints.cpp.

◆ getMirroredRawCoords()

dvecarr3E mimmo::SpecularPoints::getMirroredRawCoords ( )

It gets the coordinates of the mirrored point cloud. Meaningful after execution.

Returns
raw list of coordinates of local point cloud.

Definition at line 178 of file SpecularPoints.cpp.

◆ getMirroredScalarData()

dmpvector1D * mimmo::SpecularPoints::getMirroredScalarData ( )

Returns pointer to the scalar data field attached to mirrored cloud points

Returns
output scalar field

Definition at line 159 of file SpecularPoints.cpp.

◆ getMirroredVectorData()

dmpvecarr3E * mimmo::SpecularPoints::getMirroredVectorData ( )

Returns pointer to the vector data field attached to mirrored cloud points

Returns
output vector field

Definition at line 168 of file SpecularPoints.cpp.

◆ getOriginalScalarData()

dmpvector1D * mimmo::SpecularPoints::getOriginalScalarData ( )

Returns pointer to the original scalar data field attached to cloud points

Returns
input scalar field

Definition at line 141 of file SpecularPoints.cpp.

◆ getOriginalVectorData()

dmpvecarr3E * mimmo::SpecularPoints::getOriginalVectorData ( )

Returns pointer to the original vector data field attached to cloud points

Returns
input vector field

Definition at line 150 of file SpecularPoints.cpp.

◆ getPlane()

darray4E mimmo::SpecularPoints::getPlane ( )

Returns plane set up in the class, for mirroring

Returns
plane coefficients

Definition at line 220 of file SpecularPoints.cpp.

◆ isForced()

bool mimmo::SpecularPoints::isForced ( )

Returns if even the points belonging to the symmetry plane has to be mirrored (i.e. duplicated).

Returns
true if points on symmetry plane has to be duplicated

Definition at line 240 of file SpecularPoints.cpp.

◆ isInsideOut()

bool mimmo::SpecularPoints::isInsideOut ( )

Returns which half-space intercepeted by the plane is interested by mirroring. False represents the half-space where plane normal is directed, true the other one.

Returns
insideout flag

Definition at line 230 of file SpecularPoints.cpp.

◆ operator=()

SpecularPoints & mimmo::SpecularPoints::operator= ( SpecularPoints  other)

Assignment operator. No result are copied

Definition at line 91 of file SpecularPoints.cpp.

◆ plotOptionalResults()

void mimmo::SpecularPoints::plotOptionalResults ( )
protectedvirtual

Plot as optional results the mirrored list of points with the updated data field associated to it

Reimplemented from mimmo::ProjPrimitivesOnSurfaces.

Definition at line 657 of file SpecularPoints.cpp.

◆ setForce()

void mimmo::SpecularPoints::setForce ( bool  flag)

Set if even the points belonging to the symmetry plane have to be mirrored (i.e. duplicated).

Parameters
[in]flagtrue if the points on the symmetry plane have to be duplicated during mirroring.
Examples
utils_example_00003.cpp.

Definition at line 346 of file SpecularPoints.cpp.

◆ setInsideOut()

void mimmo::SpecularPoints::setInsideOut ( bool  flag)

Returns which half-space intercepeted by the plane is interested by mirroring.

Parameters
[in]flagfalse to select the half-space where plane normal is directed, true to select the other one.
Examples
utils_example_00003.cpp.

Definition at line 336 of file SpecularPoints.cpp.

◆ setNormal()

void mimmo::SpecularPoints::setNormal ( darray3E  normal)

It sets normal of mirroring plane

Parameters
[in]normalplane normal
Examples
utils_example_00003.cpp.

Definition at line 327 of file SpecularPoints.cpp.

◆ setOrigin()

void mimmo::SpecularPoints::setOrigin ( darray3E  origin)

It sets origin of mirroring plane

Parameters
[in]originpoint belonging to plane
Examples
utils_example_00003.cpp.

Definition at line 317 of file SpecularPoints.cpp.

◆ setPlane() [1/2]

void mimmo::SpecularPoints::setPlane ( darray3E  origin,
darray3E  normal 
)

Set Plane for mirroring cloud points. All points not belonging to plane will be mirrored

Parameters
[in]originpoints belonging to plane
[in]normalplane normal

Definition at line 297 of file SpecularPoints.cpp.

◆ setPlane() [2/2]

void mimmo::SpecularPoints::setPlane ( darray4E  plane)

Set Plane for mirroring cloud points. All points not belonging to plane will be mirrored

Parameters
[in]planecoefficients a,b,c,d of plane in its implicit form a*x+b*y+c*z+d = 0

Definition at line 285 of file SpecularPoints.cpp.

◆ setPointCloud()

void mimmo::SpecularPoints::setPointCloud ( MimmoSharedPointer< MimmoObject targetpatch)

It sets the target point cloud to be processed.

Parameters
[in]targetpatchpoint cloud to be mirrored .
Examples
utils_example_00003.cpp.

Definition at line 250 of file SpecularPoints.cpp.

◆ setScalarData()

void mimmo::SpecularPoints::setScalarData ( dmpvector1D scalardata)

Set the original scalar data field attached to target point cloud

Parameters
[in]scalardatascalar field pointer;

Definition at line 263 of file SpecularPoints.cpp.

◆ setVectorData()

void mimmo::SpecularPoints::setVectorData ( dmpvecarr3E vectordata)

Set the original vector data field attached to target point cloud

Parameters
[in]vectordatavector field pointer;
Examples
utils_example_00003.cpp.

Definition at line 274 of file SpecularPoints.cpp.

◆ swap()

void mimmo::SpecularPoints::swap ( SpecularPoints x)
protectednoexcept

Swap function

Parameters
[in]xobject to be swapped

Definition at line 100 of file SpecularPoints.cpp.


The documentation for this class was generated from the following files: