DNA Calib 1.1
Project brief
Classes | Public Member Functions | Static Public Attributes | 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
 

Static Public Attributes

static DNACAPI const sc::StatusCode PositionsMasksCountMismatch {3201, "%s"}
 

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
105 : pImpl{makeScoped<Impl>(memRes)} {
106}
ScopedPtr< Impl > pImpl
Definition: SetVertexPositionsCommand.h:110

◆ SetVertexPositionsCommand() [2/7]

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

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 
)
124 :
125 pImpl{makeScoped<Impl>(memRes)} {
126
127 pImpl->setMeshIndex(meshIndex);
128 pImpl->setPositions(xs, ys, zs);
129 pImpl->setOperation(operation);
130}

References pImpl.

◆ SetVertexPositionsCommand() [4/7]

dnac::SetVertexPositionsCommand::SetVertexPositionsCommand ( std::uint16_t  meshIndex,
ConstArrayView< Vector3 positions,
ConstArrayView< float >  masks,
VectorOperation  operation,
MemoryResource memRes = nullptr 
)
136 :
137 pImpl{makeScoped<Impl>(memRes)} {
138
139 pImpl->setMeshIndex(meshIndex);
140 pImpl->setPositions(positions);
141 pImpl->setMasks(masks);
142 pImpl->setOperation(operation);
143}

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 
)
151 :
152 pImpl{makeScoped<Impl>(memRes)} {
153
154 pImpl->setMeshIndex(meshIndex);
155 pImpl->setPositions(xs, ys, zs);
156 pImpl->setMasks(masks);
157 pImpl->setOperation(operation);
158}

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.

184 {
185 pImpl->run(static_cast<DNACalibDNAReaderImpl*>(output));
186}

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.
176 {
177 pImpl->setMasks(masks);
178}

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.
164 {
165 pImpl->setMeshIndex(meshIndex);
166}

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.
180 {
181 pImpl->setOperation(operation);
182}

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.
172 {
173 pImpl->setPositions(xs, ys, zs);
174}

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.
168 {
169 pImpl->setPositions(positions);
170}

References pImpl.

Member Data Documentation

◆ pImpl

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

◆ PositionsMasksCountMismatch

const sc::StatusCode dnac::SetVertexPositionsCommand::PositionsMasksCountMismatch {3201, "%s"}
static

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