DNA Calib 1.1
Project brief
Classes | Public Member Functions | Private Attributes | List of all members
dnac::SetVertexPositionsCommand Class Reference

SetVertexPositionsCommand is used to change vertex positions values. More...

#include <SetVertexPositionsCommand.h>

Inheritance diagram for dnac::SetVertexPositionsCommand:
Inheritance graph
Collaboration diagram for dnac::SetVertexPositionsCommand:
Collaboration graph

Classes

class  Impl
 

Public Member Functions

DNACAPI SetVertexPositionsCommand (MemoryResource *memRes=nullptr)
 
DNACAPI SetVertexPositionsCommand (std::uint16_t meshIndex, ConstArrayView< Vector3 > positions, VectorOperation operation, MemoryResource *memRes=nullptr)
 
DNACAPI SetVertexPositionsCommand (std::uint16_t meshIndex, ConstArrayView< float > xs, ConstArrayView< float > ys, ConstArrayView< float > zs, VectorOperation operation, MemoryResource *memRes=nullptr)
 
DNACAPI SetVertexPositionsCommand (std::uint16_t meshIndex, ConstArrayView< Vector3 > positions, ConstArrayView< float > masks, VectorOperation operation, MemoryResource *memRes=nullptr)
 
DNACAPI SetVertexPositionsCommand (std::uint16_t meshIndex, ConstArrayView< float > xs, ConstArrayView< float > ys, ConstArrayView< float > zs, ConstArrayView< float > masks, VectorOperation operation, MemoryResource *memRes=nullptr)
 
DNACAPI ~SetVertexPositionsCommand ()
 
 SetVertexPositionsCommand (const SetVertexPositionsCommand &)=delete
 
SetVertexPositionsCommandoperator= (const SetVertexPositionsCommand &)=delete
 
DNACAPI SetVertexPositionsCommand (SetVertexPositionsCommand &&)
 
DNACAPI SetVertexPositionsCommandoperator= (SetVertexPositionsCommand &&)
 
DNACAPI void setMeshIndex (std::uint16_t meshIndex)
 Method for setting the index of the mesh to change. More...
 
DNACAPI void setPositions (ConstArrayView< Vector3 > positions)
 Method for setting the vertex positions used to calculate new values. More...
 
DNACAPI void setPositions (ConstArrayView< float > xs, ConstArrayView< float > ys, ConstArrayView< float > zs)
 Method for setting the vertex positions used to calculate new values. More...
 
DNACAPI void setMasks (ConstArrayView< float > masks)
 Method for setting vertex masks used to calculate new vertex position values. More...
 
DNACAPI void setOperation (VectorOperation operation)
 Method for setting the type of operation used to calculate new vertex position values. More...
 
DNACAPI void run (DNACalibDNAReader *output) override
 
- Public Member Functions inherited from dnac::Command
virtual ~Command ()
 
virtual void run (DNACalibDNAReader *output)=0
 

Private Attributes

ScopedPtr< ImplpImpl
 

Detailed Description

SetVertexPositionsCommand is used to change vertex positions values.

Constructor & Destructor Documentation

◆ SetVertexPositionsCommand() [1/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( MemoryResource memRes = nullptr)
explicit
82 : pImpl{makeScoped<Impl>(memRes)} {
83}
ScopedPtr< Impl > pImpl
Definition: SetVertexPositionsCommand.h:107

◆ SetVertexPositionsCommand() [2/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( std::uint16_t  meshIndex,
ConstArrayView< Vector3 positions,
VectorOperation  operation,
MemoryResource memRes = nullptr 
)
88 :
89 pImpl{makeScoped<Impl>(memRes)} {
90
91 pImpl->setMeshIndex(meshIndex);
92 pImpl->setPositions(positions);
93 pImpl->setOperation(operation);
94}

References pImpl.

◆ SetVertexPositionsCommand() [3/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( std::uint16_t  meshIndex,
ConstArrayView< float >  xs,
ConstArrayView< float >  ys,
ConstArrayView< float >  zs,
VectorOperation  operation,
MemoryResource memRes = nullptr 
)
101 :
102 pImpl{makeScoped<Impl>(memRes)} {
103
104 pImpl->setMeshIndex(meshIndex);
105 pImpl->setPositions(xs, ys, zs);
106 pImpl->setOperation(operation);
107}

References pImpl.

◆ SetVertexPositionsCommand() [4/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( std::uint16_t  meshIndex,
ConstArrayView< Vector3 positions,
ConstArrayView< float >  masks,
VectorOperation  operation,
MemoryResource memRes = nullptr 
)
113 :
114 pImpl{makeScoped<Impl>(memRes)} {
115
116 pImpl->setMeshIndex(meshIndex);
117 pImpl->setPositions(positions);
118 pImpl->setMasks(masks);
119 pImpl->setOperation(operation);
120}

References pImpl.

◆ SetVertexPositionsCommand() [5/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( std::uint16_t  meshIndex,
ConstArrayView< float >  xs,
ConstArrayView< float >  ys,
ConstArrayView< float >  zs,
ConstArrayView< float >  masks,
VectorOperation  operation,
MemoryResource memRes = nullptr 
)
128 :
129 pImpl{makeScoped<Impl>(memRes)} {
130
131 pImpl->setMeshIndex(meshIndex);
132 pImpl->setPositions(xs, ys, zs);
133 pImpl->setMasks(masks);
134 pImpl->setOperation(operation);
135}

References pImpl.

◆ ~SetVertexPositionsCommand()

dnac::SetVertexPositionsCommand::~SetVertexPositionsCommand ( )
default

◆ SetVertexPositionsCommand() [6/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( const SetVertexPositionsCommand )
delete

◆ SetVertexPositionsCommand() [7/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( SetVertexPositionsCommand &&  )
default

Member Function Documentation

◆ operator=() [1/2]

SetVertexPositionsCommand & dnac::SetVertexPositionsCommand::operator= ( const SetVertexPositionsCommand )
delete

◆ operator=() [2/2]

SetVertexPositionsCommand & dnac::SetVertexPositionsCommand::operator= ( SetVertexPositionsCommand &&  )
default

◆ run()

void dnac::SetVertexPositionsCommand::run ( DNACalibDNAReader output)
overridevirtual

Implements dnac::Command.

161 {
162 pImpl->run(static_cast<DNACalibDNAReaderImpl*>(output));
163}

References pImpl.

◆ setMasks()

void dnac::SetVertexPositionsCommand::setMasks ( ConstArrayView< float >  masks)

Method for setting vertex masks used to calculate new vertex position values.

Note
If no masks are set, default weight value of 1 is used for each vertex.
Parameters
masksThe weights for each vertex.
153 {
154 pImpl->setMasks(masks);
155}

References pImpl.

◆ setMeshIndex()

void dnac::SetVertexPositionsCommand::setMeshIndex ( std::uint16_t  meshIndex)

Method for setting the index of the mesh to change.

Parameters
meshIndexThe mesh index.
141 {
142 pImpl->setMeshIndex(meshIndex);
143}

References pImpl.

◆ setOperation()

void dnac::SetVertexPositionsCommand::setOperation ( VectorOperation  operation)

Method for setting the type of operation used to calculate new vertex position values.

Note
Available operations are: Interpolate, Add, Subtract and Multiply. Each position is calculated based on the provided operation type in the following way:

Interpolate: $newValue = previousValue * (1 - weight) + setValue * weight$
Add: $newValue = previousValue + (setValue * weight)$
Subtract: $newValue = previousValue - (setValue * weight)$
Multiply: $newValue = previousValue * (setValue * weight)$
setValue is the value from new positions that were set, and weight is the value from masks array.

Parameters
operationThe operation to use.
157 {
158 pImpl->setOperation(operation);
159}

References pImpl.

◆ setPositions() [1/2]

void dnac::SetVertexPositionsCommand::setPositions ( ConstArrayView< float >  xs,
ConstArrayView< float >  ys,
ConstArrayView< float >  zs 
)

Method for setting the vertex positions used to calculate new values.

Parameters
xsThe X coordinates for each vertex.
ysThe Y coordinates for each vertex.
zsThe Z coordinates for each vertex.
149 {
150 pImpl->setPositions(xs, ys, zs);
151}

References pImpl.

◆ setPositions() [2/2]

void dnac::SetVertexPositionsCommand::setPositions ( ConstArrayView< Vector3 positions)

Method for setting the vertex positions used to calculate new values.

Parameters
positionsThe vertex positions.
145 {
146 pImpl->setPositions(positions);
147}

References pImpl.

Member Data Documentation

◆ pImpl

ScopedPtr<Impl> dnac::SetVertexPositionsCommand::pImpl
private

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