DNA Calib 1.1
Project brief
Namespaces | Classes | Typedefs | Enumerations | Functions
dnac Namespace Reference

Namespaces

namespace  anonymous_namespace{VersionInfo.cpp}
 

Classes

class  AnimatedMapFilter
 
class  BaseImpl
 
class  BlendShapeFilter
 
class  BoundingBox
 
class  CalculateMeshLowerLODsCommand
 CalculateMeshLowerLODsCommand is used to recalculate vertex positions for lower LOD meshes of the specified mesh. More...
 
class  ClearBlendShapesCommand
 ClearBlendShapesCommand is used to clear all blend shapes data from a DNA. More...
 
class  Command
 Command is an abstract class whose implementations are expected to modify the DNA provided in the run() method in some way. More...
 
class  CommandImplBase
 
class  CommandSequence
 CommandSequence is used to run a sequence of commands on the same DNA. More...
 
class  ConditionalCommand
 ConditionalCommand is used to run a command if the specified condition is met. More...
 
struct  DenormalizedData
 
struct  DNA
 
class  DNACalibDNAReader
 
class  DNACalibDNAReaderImpl
 
struct  ExpectedValue
 
class  JointFilter
 
class  LODConstraint
 
class  LODMapping
 
class  MeshFilter
 
struct  OperationFactory
 
class  PruneBlendShapeTargetsCommand
 PruneBlendShapeTargetsCommand is used to prune blend shape target deltas whose absolute magnitude is less than or equal to the specified threshold. More...
 
struct  RawAnimatedMaps
 
struct  RawBehavior
 
struct  RawBlendShapeChannels
 
struct  RawBlendShapeTarget
 
struct  RawConditionalTable
 
struct  RawControls
 
struct  RawCoordinateSystem
 
struct  RawDefinition
 
struct  RawDescriptor
 
struct  RawFace
 
struct  RawGeometry
 
struct  RawJointGroup
 
struct  RawJoints
 
struct  RawLODMapping
 
struct  RawMesh
 
struct  RawPSDMatrix
 
struct  RawSurjectiveMapping
 
struct  RawTextureCoordinateVector
 
struct  RawVector3Vector
 
struct  RawVertexLayoutVector
 
struct  RawVertexSkinWeights
 
class  ReaderImpl
 
class  RemoveAnimatedMapCommand
 RemoveAnimatedMapCommand is used to remove animated maps. More...
 
class  RemoveBlendShapeCommand
 RemoveBlendShapeCommand is used to remove blend shapes. More...
 
class  RemoveJointAnimationCommand
 RemoveJointAnimationCommand is used to remove joint animation data. More...
 
class  RemoveJointCommand
 RemoveJointCommand is used to remove joints. More...
 
class  RemoveMeshCommand
 RemoveMeshCommand is used to remove meshes. More...
 
class  RenameAnimatedMapCommand
 RenameAnimatedMapCommand is used to rename an animated map. More...
 
class  RenameBlendShapeCommand
 RenameBlendShapeCommand is used to rename a blend shape channel. More...
 
class  RenameJointCommand
 RenameJointCommand is used to rename a joint. More...
 
class  RenameMeshCommand
 RenameMeshCommand is used to rename a mesh. More...
 
class  RenameResourceCommand
 
class  RotateCommand
 RotateCommand is used to rotate neutral joints and vertex positions around given origin. More...
 
class  ScaleCommand
 ScaleCommand is used to scale neutral joints, vertex positions and joint and blendshape deltas by a factor. More...
 
struct  SectionLookupTable
 
class  SetBlendShapeTargetDeltasCommand
 SetBlendShapeTargetDeltasCommand is used to change blend shape target deltas. More...
 
class  SetLODsCommand
 SetLODsCommand is used to specify LODs to use. Joints, blend shapes, animated maps and meshes that are not in specified LODs are removed from the DNA. More...
 
class  SetNeutralJointRotationsCommand
 SetNeutralJointRotationsCommand is used to set new rotation values to neutral joints. More...
 
class  SetNeutralJointTranslationsCommand
 SetNeutralJointTranslationsCommand is used to set new translation values to neutral joints. More...
 
class  SetSkinWeightsCommand
 SetSkinWeightsCommand is used to set new skin weights for a vertex in a mesh. More...
 
class  SetVertexPositionsCommand
 SetVertexPositionsCommand is used to change vertex positions values. More...
 
struct  Signature
 
struct  SurjectiveMapping
 
class  TranslateCommand
 TranslateCommand is used to translate neutral joints and vertex positions. More...
 
class  Triangle
 
class  UVBarycentricMapping
 
struct  Version
 
struct  VersionInfo
 
struct  WeightGetterFactory
 
class  WriterImpl
 

Typedefs

template<typename T >
using ArrayView = dna::ArrayView< T >
 
template<typename T >
using ConstArrayView = dna::ConstArrayView< T >
 
template<typename T >
using AlignedAllocator = PolyAllocator< T, 64ul, AlignedMemoryResource >
 
template<typename T >
using DynArray = terse::DynArray< T, PolyAllocator< T > >
 
template<typename T >
using AlignedDynArray = terse::DynArray< T, AlignedAllocator< T > >
 

Enumerations

enum class  VectorOperation { Interpolate , Add , Subtract , Multiply }
 

Functions

template<class TCommand , class TCondition >
ConditionalCommand< TCommand, TCondition > makeConditional (TCommand *command, TCondition condition)
 
template<typename T >
void remap (T originalCount, const UnorderedSet< T > &keptIndices, UnorderedMap< T, T > &mapping)
 
template<class TContainer , typename ... Args>
void ensureHasSize (TContainer &target, std::size_t size, Args &&... args)
 
fmat4 getTransformationMatrix (const fvec3 &translation, const fvec3 &rotation, const fvec3 &scale={1.0f, 1.0f, 1.0f})
 
fmat4 extractTranslationMatrix (const fmat4 &transformationMatrix)
 
fvec3 extractScaleVector (const fmat4 &transformationMatrix)
 
fmat4 extractRotationMatrix (const fmat4 &transformationMatrix)
 
fvec3 extractTranslationVector (const fmat4 &transformationMatrix)
 
fvec3 extractRotationVector (const fmat4 &transformationMatrix)
 
template<typename ... Args>
String< char > formatString (MemoryResource *memRes, const char *format, Args &&... args)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type operator& (TEnum lhs, TEnum rhs)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type operator| (TEnum lhs, TEnum rhs)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type operator^ (TEnum lhs, TEnum rhs)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type operator~ (TEnum value)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type operator&= (TEnum &lhs, TEnum rhs)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type operator|= (TEnum &lhs, TEnum rhs)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type operator^= (TEnum &lhs, TEnum rhs)
 
template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, bool >::type contains (TEnum lhs, TEnum rhs)
 

Typedef Documentation

◆ AlignedAllocator

template<typename T >
using dnac::AlignedAllocator = typedef PolyAllocator<T, 64ul, AlignedMemoryResource>

◆ AlignedDynArray

template<typename T >
using dnac::AlignedDynArray = typedef terse::DynArray<T, AlignedAllocator<T> >

◆ ArrayView

template<typename T >
using dnac::ArrayView = typedef dna::ArrayView<T>

◆ ConstArrayView

template<typename T >
using dnac::ConstArrayView = typedef dna::ConstArrayView<T>

◆ DynArray

template<typename T >
using dnac::DynArray = typedef terse::DynArray<T, PolyAllocator<T> >

Enumeration Type Documentation

◆ VectorOperation

enum class dnac::VectorOperation
strong
Enumerator
Interpolate 
Add 
Subtract 
Multiply 

Function Documentation

◆ contains()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, bool >::type dnac::contains ( TEnum  lhs,
TEnum  rhs 
)
57 {
58 return (lhs & rhs) == rhs;
59}

Referenced by dnac::UVBarycentricMapping::getBarycentric().

◆ ensureHasSize()

template<class TContainer , typename ... Args>
void dnac::ensureHasSize ( TContainer &  target,
std::size_t  size,
Args &&...  args 
)
26 {
27 target.reserve(size);
28 while (target.size() < size) {
29 target.push_back(typename TContainer::value_type(std::forward<Args>(args)...));
30 }
31}

Referenced by dnac::WriterImpl< TWriterBase >::setAnimatedMapName(), dnac::WriterImpl< TWriterBase >::setBlendShapeChannelIndex(), dnac::WriterImpl< TWriterBase >::setBlendShapeChannelName(), dnac::WriterImpl< TWriterBase >::setBlendShapeTargetDeltas(), dnac::DNACalibDNAReaderImpl::setBlendShapeTargetDeltas(), dnac::WriterImpl< TWriterBase >::setBlendShapeTargetVertexIndices(), dnac::DNACalibDNAReaderImpl::setBlendShapeTargetVertexIndices(), dnac::WriterImpl< TWriterBase >::setFaceVertexLayoutIndices(), dnac::WriterImpl< TWriterBase >::setGUIControlName(), dnac::WriterImpl< TWriterBase >::setJointGroupInputIndices(), dnac::WriterImpl< TWriterBase >::setJointGroupJointIndices(), dnac::WriterImpl< TWriterBase >::setJointGroupLODs(), dnac::WriterImpl< TWriterBase >::setJointGroupOutputIndices(), dnac::DNACalibDNAReaderImpl::setJointGroupValues(), dnac::WriterImpl< TWriterBase >::setJointGroupValues(), dnac::WriterImpl< TWriterBase >::setJointName(), dnac::WriterImpl< TWriterBase >::setMaximumInfluencePerVertex(), dnac::WriterImpl< TWriterBase >::setMeshName(), dnac::WriterImpl< TWriterBase >::setRawControlName(), dnac::WriterImpl< TWriterBase >::setSkinWeightsJointIndices(), dnac::WriterImpl< TWriterBase >::setSkinWeightsValues(), dnac::WriterImpl< TWriterBase >::setVertexLayouts(), dnac::WriterImpl< TWriterBase >::setVertexNormals(), dnac::WriterImpl< TWriterBase >::setVertexPositions(), dnac::DNACalibDNAReaderImpl::setVertexPositions(), and dnac::WriterImpl< TWriterBase >::setVertexTextureCoordinates().

◆ extractRotationMatrix()

fmat4 dnac::extractRotationMatrix ( const fmat4 transformationMatrix)
inline
29 {
30 auto r = transformationMatrix;
31 r(3, 0) = 0.0f;
32 r(3, 1) = 0.0f;
33 r(3, 2) = 0.0f;
34 const auto scale = tdm::scale(extractScaleVector(transformationMatrix));
35 const auto inverseScale = tdm::inverse(scale);
36 return inverseScale * r;
37}
fvec3 extractScaleVector(const fmat4 &transformationMatrix)
Definition: Algorithm.h:21
mat< L, L, T > scale(const vec< L, T > &factors)
Definition: Transforms.h:29
mat< L+1, L+1, T > scale(const vec< L, T > &factors)
Definition: Transforms.h:123
mat< N, N, T > inverse(const mat< N, N, T > &m)
Definition: Computations.h:134

References extractScaleVector(), tdm::inverse(), and tdm::affine::scale().

Referenced by extractRotationVector().

◆ extractRotationVector()

fvec3 dnac::extractRotationVector ( const fmat4 transformationMatrix)
inline
43 {
44 fvec3 angle{};
45 const auto r = extractRotationMatrix(transformationMatrix);
46 const auto r02 = r(0, 2);
47 if (r02 < 1.0f) {
48 if (r02 > -1.0f) {
49 angle[0] = std::atan2(r(1, 2), r(2, 2));
50 angle[1] = std::asin(-r02);
51 angle[2] = std::atan2(r(0, 1), r(0, 0));
52 } else {
53 angle[0] = std::atan2(-r(2, 1), r(1, 1));
54 angle[1] = static_cast<float>(tdm::pi() / 2.0f);
55 angle[2] = 0;
56 }
57 } else {
58 angle[0] = -std::atan2(-r(2, 1), r(1, 1));
59 angle[1] = static_cast<float>(-tdm::pi() / 2.0f);
60 angle[2] = 0;
61 }
62 return angle;
63}
fmat4 extractRotationMatrix(const fmat4 &transformationMatrix)
Definition: Algorithm.h:29
constexpr double pi()
Definition: Transforms.h:10
Definition: Vec.h:10

References extractRotationMatrix(), and tdm::pi().

Referenced by dnac::RotateCommand::Impl::rotateNeutralJoints().

◆ extractScaleVector()

fvec3 dnac::extractScaleVector ( const fmat4 transformationMatrix)
inline
21 {
22 const auto& m = transformationMatrix;
23 const float sx = fvec3{m(0, 0), m(0, 1), m(0, 2)}.length();
24 const float sy = fvec3{m(1, 0), m(1, 1), m(1, 2)}.length();
25 const float sz = fvec3{m(2, 0), m(2, 1), m(2, 2)}.length();
26 return {sx, sy, sz};
27}
fvec< 3 > fvec3
Definition: Types.h:51

Referenced by extractRotationMatrix().

◆ extractTranslationMatrix()

fmat4 dnac::extractTranslationMatrix ( const fmat4 transformationMatrix)
inline
13 {
14 auto t = fmat4::identity();
15 t(3, 0) = transformationMatrix(3, 0);
16 t(3, 1) = transformationMatrix(3, 1);
17 t(3, 2) = transformationMatrix(3, 2);
18 return t;
19}

References tdm::mat< R, C, T >::identity().

◆ extractTranslationVector()

fvec3 dnac::extractTranslationVector ( const fmat4 transformationMatrix)
inline
39 {
40 return {transformationMatrix(3, 0), transformationMatrix(3, 1), transformationMatrix(3, 2)};
41}

Referenced by dnac::RotateCommand::Impl::rotateNeutralJoints().

◆ formatString()

template<typename ... Args>
String< char > dnac::formatString ( MemoryResource memRes,
const char *  format,
Args &&...  args 
)
10 {
11 String<char> result{memRes};
12 result.resize(1024);
13 #if !defined(__clang__) && defined(__GNUC__)
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wformat-security"
16 #endif
17 // The returned number of bytes to be written does not include the null terminator
18 const auto neededSize = snprintf(nullptr, 0ul, format, args ...) + 1;
19 const auto size = std::min(result.size(), static_cast<std::size_t>(neededSize));
20 snprintf(&result[0], size, format, args ...);
21 #if !defined(__clang__) && defined(__GNUC__)
22 #pragma GCC diagnostic pop
23 #endif
24 result.resize(size);
25 return result;
26}
std::basic_string< T, std::char_traits< T >, Allocator > String
Definition: include/pma/TypeDefs.h:26

Referenced by dnac::SetBlendShapeTargetDeltasCommand::Impl::computeBlendShapeTargetDeltas(), and dnac::SetVertexPositionsCommand::Impl::computeVertexPositions().

◆ getTransformationMatrix()

fmat4 dnac::getTransformationMatrix ( const fvec3 translation,
const fvec3 rotation,
const fvec3 scale = {1.0f, 1.0f, 1.0f} 
)
inline
9 {1.0f, 1.0f, 1.0f}) {
10 return tdm::scale(scale) * tdm::rotate(rotation) * tdm::translate(translation);
11}
mat4< T > rotate(const vec3< T > &axis, T radians, handedness h=handedness::right)
Definition: Transforms.h:53
mat< L+1, L+1, T > translate(const vec< L, T > &position)
Definition: Transforms.h:147

◆ makeConditional()

template<class TCommand , class TCondition >
ConditionalCommand< TCommand, TCondition > dnac::makeConditional ( TCommand *  command,
TCondition  condition 
)
70 {
71 return ConditionalCommand<TCommand, TCondition>{command, condition};
72}
ConditionalCommand is used to run a command if the specified condition is met.
Definition: ConditionalCommand.h:15

Referenced by main().

◆ operator&()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type dnac::operator& ( TEnum  lhs,
TEnum  rhs 
)
11 {
12 using Underlying = typename std::underlying_type<TEnum>::type;
13 return static_cast<TEnum>(static_cast<Underlying>(lhs) & static_cast<Underlying>(rhs));
14}

◆ operator&=()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type dnac::operator&= ( TEnum &  lhs,
TEnum  rhs 
)
39 {
40 return lhs = (lhs & rhs);
41}

◆ operator^()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type dnac::operator^ ( TEnum  lhs,
TEnum  rhs 
)
25 {
26 using Underlying = typename std::underlying_type<TEnum>::type;
27 return static_cast<TEnum>(static_cast<Underlying>(lhs) ^ static_cast<Underlying>(rhs));
28}

◆ operator^=()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type dnac::operator^= ( TEnum &  lhs,
TEnum  rhs 
)
51 {
52 return lhs = (lhs ^ rhs);
53}

◆ operator|()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type dnac::operator| ( TEnum  lhs,
TEnum  rhs 
)
18 {
19 using Underlying = typename std::underlying_type<TEnum>::type;
20 return static_cast<TEnum>(static_cast<Underlying>(lhs) | static_cast<Underlying>(rhs));
21}

◆ operator|=()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type dnac::operator|= ( TEnum &  lhs,
TEnum  rhs 
)
45 {
46 return lhs = (lhs | rhs);
47}

◆ operator~()

template<typename TEnum >
std::enable_if< std::is_enum< TEnum >::value, TEnum >::type dnac::operator~ ( TEnum  value)
32 {
33 using Underlying = typename std::underlying_type<TEnum>::type;
34 return static_cast<TEnum>(~static_cast<Underlying>(value));
35}

◆ remap()

template<typename T >
void dnac::remap ( originalCount,
const UnorderedSet< T > &  keptIndices,
UnorderedMap< T, T > &  mapping 
)
inline
11 {
12 for (T oldIndex{}, newIndex{}; oldIndex < originalCount; ++oldIndex) {
13 if (extd::contains(keptIndices, oldIndex)) {
14 mapping.insert({oldIndex, newIndex});
15 ++newIndex;
16 }
17 }
18}
bool contains(TInputIterator first, TInputIterator last, const T &value)
Definition: utils/Extd.h:40

References extd::contains().

Referenced by dnac::AnimatedMapFilter::configure(), dnac::BlendShapeFilter::configure(), dnac::JointFilter::configure(), and dnac::MeshFilter::configure().