/usr/include/opencollada/COLLADAStreamWriter/COLLADASWLibraryAnimations.h is in opencollada-dev 0.1.0~20140703.ddf8f47+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | /*
Copyright (c) 2008-2009 NetAllied Systems GmbH
This file is part of COLLADAStreamWriter.
Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __COLLADASTREAMWRITER_LIBRARY_ANIMATION_H__
#define __COLLADASTREAMWRITER_LIBRARY_ANIMATION_H__
#include "COLLADASWPrerequisites.h"
#include "COLLADASWLibrary.h"
#include "COLLADASWInputList.h"
#include "COLLADABUURI.h"
#include <vector>
#include <list>
namespace COLLADASW
{
/**
* Class which represent an animation element.
* This is needed, cause we have to be able to nest multiple animations.
*/
class Animation : public ElementWriter
{
public:
Animation ( StreamWriter* streamWriter ) : ElementWriter ( streamWriter ) {}
/** Writes the opening @a \<Animation\> tag and, if necessary the opening @a \<library_animations\> tag.
closeAnimation() must be use to close the opened tags.
@param id the id of the animation
@param name the name of the animation*/
void openAnimation ( const String& id = EMPTY_STRING, const String& name = EMPTY_STRING );
/** Closes the tag opened by openAnimation()*/
void closeAnimation();
private:
/** The closer for the current animation tag. */
TagCloser mAnimationCloser;
};
/**
* Class to simply the creation of @a \<library_geometries\> and @a \<geometry\>'s
*/
class LibraryAnimations : public Library
{
public:
class Sampler
{
/** semantics formerly defined here have been moved to COLLADASWInputList.h */
private:
/** The id of the sampler*/
String mId;
/** The list of inputs of the sampler*/
InputList mInputList;
public:
/** Constructor
@param id The id of the sampler.
*/
Sampler ( StreamWriter * streamWriter, const String& id );
/** Returns a const reference of the sampler id*/
const String& getId() const
{
return mId;
}
/** Adds an input element to the sampler*/
void addInput ( InputSemantic::Semantics semantic, const COLLADABU::URI& source );
/** Returns a const reference of the Inputlist*/
const InputList& getInputList() const
{
return mInputList;
}
};
LibraryAnimations ( StreamWriter * streamWriter );
static const String LINEAR_NAME;
static const String BEZIER_NAME;
static const String CARDINAL_NAME;
static const String HERMITE_NAME;
static const String BSPLINE_NAME;
static const String TCB_NAME;
static const String STEP_NAME;
/** An animation curve interpolation type. */
enum InterpolationType
{
LINEAR=0, /**< Linear interpolation. Uses the average slope between the previous key
and the next key. */
BEZIER, /**< Bezier interpolation. Uses two 2D control points for each segment,
wrongly called in-tangent and out-tangent in COLLADASW. */
CARDINAL,
HERMITE,
BSPLINE,
STEP, /**< No interpolation. Uses the output value of the previous key until the
next key time is reached. */
TCB, /**< TCB interpolation. Uses Tension, Continuity and Bias values to generate
Hermite tangents. This interpolation type is not standard COLLADASW. */
DEFAULT = STEP
};
static const String INPUT_SOURCE_ID_SUFFIX;
static const String OUTPUT_SOURCE_ID_SUFFIX;
static const String INTANGENT_SOURCE_ID_SUFFIX;
static const String OUTTANGENT_SOURCE_ID_SUFFIX;
static const String INTERPOLATION_SOURCE_ID_SUFFIX;
static const String TCBS_SOURCE_ID_SUFFIX;
static const String EASES_SOURCE_ID_SUFFIX;
static const String ARRAY_ID_SUFFIX;
static const String SAMPLER_ID_SUFFIX;
protected:
/** Writes the opening @a \<Animation\> tag and, if necessary the opening @a \<library_animations\> tag.
closeAnimation() must be use to close the opened tags.
@param id the id of the animation
@param name the name of the animation*/
void openAnimation ( const String& id = EMPTY_STRING, const String& name = EMPTY_STRING );
/** Closes the tag opened by openAnimation()*/
void closeAnimation();
/** Adds the @a sampler to the stream*/
void addSampler ( const Sampler& sampler );
/** Adds channel with @a source and @a target to the animation*/
void addChannel ( const URI& source, const String& target );
/** Returns the name of the interpolation type*/
static const String& getNameOfInterpolation ( const InterpolationType& type );
private:
/** This vector holds all open animations. We need this to nest multiple animations. */
std::vector<Animation*> mOpenAnimations;
};
} //namespace COLLADASW
#endif //__COLLADASTREAMWRITER_LIBRARY_ANIMATION_H__
|