Add publish
This commit is contained in:
710
publish/publishsource/AnimWorkinstruction/AnimDef.cpp
Normal file
710
publish/publishsource/AnimWorkinstruction/AnimDef.cpp
Normal file
@@ -0,0 +1,710 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDef.cpp
|
||||
|
||||
Library of common functions to define Motions and Keyframes
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
// creates a view
|
||||
A3DStatus CreateView(A3DPDFDocument* pDoc, A3DPDF3DArtwork* p3DArtwork,
|
||||
A3DDouble dPosX, A3DDouble dPosY, A3DDouble dPosZ,
|
||||
A3DDouble dTargetX, A3DDouble dTargetY, A3DDouble dTargetZ,
|
||||
A3DDouble dUpX, A3DDouble dUpY, A3DDouble dUpZ,
|
||||
A3DPDFEProjectionMode eProjectionMode,
|
||||
A3DDouble dZoomFactor, A3DDouble dFieldOfView,
|
||||
A3DBool bIsDefault, const A3DUTF8Char* pcViewName,
|
||||
A3DPDFView** ppView)
|
||||
{
|
||||
A3DPDFViewData sViewData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFViewData, sViewData);
|
||||
|
||||
sViewData.m_sViewBackgroundColor.m_dBlue = 0.25;
|
||||
sViewData.m_sViewBackgroundColor.m_dGreen = 0.25;
|
||||
sViewData.m_sViewBackgroundColor.m_dRed = 0.25;
|
||||
sViewData.m_eViewLighting = kA3DPDFLightCADOptimized;
|
||||
sViewData.m_eViewRenderingStyle = kA3DPDFRenderingSolid;
|
||||
|
||||
sViewData.m_sPosition.m_dX = dPosX;
|
||||
sViewData.m_sPosition.m_dY = dPosY;
|
||||
sViewData.m_sPosition.m_dZ = dPosZ;
|
||||
|
||||
sViewData.m_sTarget.m_dX = dTargetX;
|
||||
sViewData.m_sTarget.m_dY = dTargetY;
|
||||
sViewData.m_sTarget.m_dZ = dTargetZ;
|
||||
|
||||
sViewData.m_sUpVector.m_dX = dUpX;
|
||||
sViewData.m_sUpVector.m_dY = dUpY;
|
||||
sViewData.m_sUpVector.m_dZ = dUpZ;
|
||||
|
||||
sViewData.m_eProjectionMode = eProjectionMode;
|
||||
sViewData.m_dZoomFactor = dZoomFactor; // only valid for orthographic projection
|
||||
sViewData.m_dFieldOfView = dFieldOfView; // only valid for perspective projection
|
||||
sViewData.m_bIsDefault = bIsDefault;
|
||||
|
||||
size_t iLen = strlen(pcViewName);
|
||||
sViewData.m_pcExternalName = new A3DUTF8Char[iLen+1];
|
||||
strcpy(sViewData.m_pcExternalName, pcViewName);
|
||||
|
||||
A3DPDFViewCreate(pDoc, &sViewData, ppView);
|
||||
delete []sViewData.m_pcExternalName;
|
||||
|
||||
A3DPDF3DArtworkAddView(p3DArtwork, *ppView);
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static double stadMatrix[16];
|
||||
|
||||
static void stMatrixMatrixMult(double m[16], const double o[16])
|
||||
{
|
||||
memcpy(stadMatrix, m, 16*sizeof(double));
|
||||
stadMatrix[12] = 0;
|
||||
stadMatrix[13] = 0;
|
||||
stadMatrix[14] = 0;
|
||||
stadMatrix[15] = 1;
|
||||
m[0] = stadMatrix[0] * o[0] + stadMatrix[4] * o[1] + stadMatrix[8] * o[2] + stadMatrix[12] * o[3];
|
||||
m[1] = stadMatrix[1] * o[0] + stadMatrix[5] * o[1] + stadMatrix[9] * o[2] + stadMatrix[13] * o[3];
|
||||
m[2] = stadMatrix[2] * o[0] + stadMatrix[6] * o[1] + stadMatrix[10] * o[2] + stadMatrix[14] * o[3];
|
||||
m[3] = stadMatrix[3] * o[0] + stadMatrix[7] * o[1] + stadMatrix[11] * o[2] + stadMatrix[15] * o[3];
|
||||
m[4] = stadMatrix[0] * o[4] + stadMatrix[4] * o[5] + stadMatrix[8] * o[6] + stadMatrix[12] * o[7];
|
||||
m[5] = stadMatrix[1] * o[4] + stadMatrix[5] * o[5] + stadMatrix[9] * o[6] + stadMatrix[13] * o[7];
|
||||
m[6] = stadMatrix[2] * o[4] + stadMatrix[6] * o[5] + stadMatrix[10] * o[6] + stadMatrix[14] * o[7];
|
||||
m[7] = stadMatrix[3] * o[4] + stadMatrix[7] * o[5] + stadMatrix[11] * o[6] + stadMatrix[15] * o[7];
|
||||
m[8] = stadMatrix[0] * o[8] + stadMatrix[4] * o[9] + stadMatrix[8] * o[10] + stadMatrix[12] * o[11];
|
||||
m[9] = stadMatrix[1] * o[8] + stadMatrix[5] * o[9] + stadMatrix[9] * o[10] + stadMatrix[13] * o[11];
|
||||
m[10]= stadMatrix[2] * o[8] + stadMatrix[6] * o[9] + stadMatrix[10] * o[10] + stadMatrix[14] * o[11];
|
||||
m[11]= stadMatrix[3] * o[8] + stadMatrix[7] * o[9] + stadMatrix[11] * o[10] + stadMatrix[15] * o[11];
|
||||
m[12]= stadMatrix[0] * o[12] + stadMatrix[4] * o[13] + stadMatrix[8] * o[14] + stadMatrix[12] * o[15];
|
||||
m[13]= stadMatrix[1] * o[12] + stadMatrix[5] * o[13] + stadMatrix[9] * o[14] + stadMatrix[13] * o[15];
|
||||
m[14]= stadMatrix[2] * o[12] + stadMatrix[6] * o[13] + stadMatrix[10] * o[14] + stadMatrix[14] * o[15];
|
||||
m[15]= stadMatrix[3] * o[12] + stadMatrix[7] * o[13] + stadMatrix[11] * o[14] + stadMatrix[15] * o[15];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#define X 0
|
||||
#define Y 1
|
||||
#define Z 2
|
||||
#define W 3
|
||||
void hoopsQuaternionToMatrix(double * quaternion, double *matrix)
|
||||
{
|
||||
double s, xs, ys, zs, wx, wy, wz, xx, xy, xz, yy, yz, zz;
|
||||
|
||||
s = 2.0/(quaternion[X]*quaternion[X] + quaternion[Y]*quaternion[Y] + quaternion[Z]*quaternion[Z] + quaternion[W]*quaternion[W]);
|
||||
|
||||
xs = quaternion[X]*s; ys = quaternion[Y]*s; zs = quaternion[Z]*s;
|
||||
wx = quaternion[W]*xs; wy = quaternion[W]*ys; wz = quaternion[W]*zs;
|
||||
xx = quaternion[X]*xs; xy = quaternion[X]*ys; xz = quaternion[X]*zs;
|
||||
yy = quaternion[Y]*ys; yz = quaternion[Y]*zs; zz = quaternion[Z]*zs;
|
||||
|
||||
matrix[0] = 1.0 - (yy+zz);
|
||||
matrix[1] = xy + wz;
|
||||
matrix[2] = xz - wy;
|
||||
|
||||
matrix[4] = xy - wz;
|
||||
matrix[5] = 1.0 - (xx + zz);
|
||||
matrix[6] = yz + wx;
|
||||
|
||||
|
||||
matrix[8] = xz + wy;
|
||||
matrix[9] = yz - wx;
|
||||
matrix[10] = 1.0 - (xx + yy);
|
||||
}
|
||||
|
||||
void stLoadIdentityMatrix(double adMat[16])
|
||||
{
|
||||
int i;
|
||||
for(i = 1; i < 15; i++)
|
||||
adMat[i]=0;
|
||||
adMat[0] = adMat[5] = adMat[10] = adMat[15] = 1.;
|
||||
}
|
||||
|
||||
void stApplyPositionToMatrix(double adMat[16], double dPosX, double dPosY, double dPosZ)
|
||||
{
|
||||
adMat[12] += dPosX; adMat[13] += dPosY; adMat[14] += dPosZ;
|
||||
}
|
||||
void stCopyMatrix(A3DDouble adMatrix[16], double adMat[16])
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < 16; i++)
|
||||
adMatrix[i] = adMat[i];
|
||||
}
|
||||
|
||||
void AddKeyFrameTransfo(A3DPDFAnimKeyFrame**& ppKeyFrame, int& idxkeyframe,
|
||||
A3DDouble dTime, double adMat[16],
|
||||
bool bQuat, double dQuatW, double dQuatX, double dQuatY, double dQuatZ,
|
||||
double dPosX, double dPosY, double dPosZ,
|
||||
double dR, double dG, double dB,
|
||||
double dOpacity,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
int iApplyAppearance = 0)
|
||||
{
|
||||
A3DPDFAnimKeyFrame* pKeyFrame;
|
||||
A3DPDFAnimKeyFrameData sKeyFrameData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimKeyFrameData, sKeyFrameData);
|
||||
sKeyFrameData.m_dTime = dTime;
|
||||
if(iApplyAppearance == 0)
|
||||
sKeyFrameData.m_iInterpolationMask =
|
||||
kA3DPDFInterpolateTransformationMatrix |
|
||||
kA3DPDFInterpolateAppearanceColor |
|
||||
kA3DPDFInterpolateAppearanceTransparency;
|
||||
else if(iApplyAppearance == 1)
|
||||
sKeyFrameData.m_iInterpolationMask =
|
||||
kA3DPDFInterpolateTransformationMatrix;
|
||||
else if(iApplyAppearance == 2)
|
||||
sKeyFrameData.m_iInterpolationMask = 0;
|
||||
|
||||
A3DPDFAnimAppearanceData sAppearanceData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimAppearanceData, sAppearanceData);
|
||||
sAppearanceData.m_sColor.m_dRed = dR;
|
||||
sAppearanceData.m_sColor.m_dGreen = dG;
|
||||
sAppearanceData.m_sColor.m_dBlue = dB;
|
||||
sAppearanceData.m_dOpacity = dOpacity;
|
||||
sAppearanceData.m_eRenderingStyle = eRenderingStyle;
|
||||
sKeyFrameData.m_psAppearanceData = &sAppearanceData;
|
||||
|
||||
A3DPDFAnimTransformationData sTransfoData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimTransformationData, sTransfoData);
|
||||
sKeyFrameData.m_psTransformationData = &sTransfoData;
|
||||
|
||||
if(bQuat)
|
||||
{
|
||||
double adQuat[4];
|
||||
adQuat[0] = dQuatW;
|
||||
adQuat[1] = dQuatX;
|
||||
adQuat[2] = dQuatY;
|
||||
adQuat[3] = dQuatZ;
|
||||
double adRot[16];
|
||||
stLoadIdentityMatrix(adRot);
|
||||
hoopsQuaternionToMatrix(adQuat, adRot);
|
||||
stMatrixMatrixMult(adMat, adRot);
|
||||
}
|
||||
|
||||
stApplyPositionToMatrix(adMat, dPosX, dPosY, dPosZ);
|
||||
stCopyMatrix(sTransfoData.m_adMatrix, adMat);//better would be to cast...
|
||||
|
||||
A3DPDFAnimKeyFrameCreate(&sKeyFrameData, &pKeyFrame);
|
||||
ppKeyFrame[idxkeyframe++] = pKeyFrame;
|
||||
}
|
||||
|
||||
void AddKeyFrameAppearance(A3DPDFAnimKeyFrame**& ppKeyFrame, int& idxkeyframe,
|
||||
A3DDouble dTime,
|
||||
int iInterpolationMask,
|
||||
double dR, double dG, double dB,
|
||||
double dOpacity,
|
||||
A3DPDFERenderingStyle eRenderingStyle)
|
||||
{
|
||||
A3DPDFAnimKeyFrame* pKeyFrame;
|
||||
A3DPDFAnimKeyFrameData sKeyFrameData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimKeyFrameData, sKeyFrameData);
|
||||
sKeyFrameData.m_dTime = dTime; // seconds
|
||||
sKeyFrameData.m_iInterpolationMask = iInterpolationMask;
|
||||
|
||||
A3DPDFAnimAppearanceData sAppearanceData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimAppearanceData, sAppearanceData);
|
||||
|
||||
// -1 + bool at false should be specified to not take these values into account:
|
||||
// -1 for colors and kA3DPDFInterpolateAppearanceColor not specified => no color change ;
|
||||
// -1 for opacity and kA3DPDFInterpolateAppearanceTransparency not specified => no opacity change
|
||||
sAppearanceData.m_sColor.m_dRed = dR;
|
||||
sAppearanceData.m_sColor.m_dGreen = dG;
|
||||
sAppearanceData.m_sColor.m_dBlue = dB;
|
||||
sAppearanceData.m_dOpacity = dOpacity;
|
||||
sAppearanceData.m_eRenderingStyle = eRenderingStyle;
|
||||
|
||||
sKeyFrameData.m_psAppearanceData = &sAppearanceData;
|
||||
|
||||
A3DPDFAnimKeyFrameCreate(&sKeyFrameData, &pKeyFrame);
|
||||
ppKeyFrame[idxkeyframe++] = pKeyFrame;
|
||||
}
|
||||
|
||||
|
||||
|
||||
A3DStatus CreateMotionAppearInit(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DMiscMarkupLinkedItem** ppTargets, int idxTargets,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
double dOpacInit,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration)
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
const int INBKEYFRAMESALLOC = 10;
|
||||
A3DPDFAnimKeyFrame** ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame = 0;
|
||||
|
||||
if(! (dColInitR == -1 && dColInitG == -1 && dColInitB == -1) )
|
||||
{
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
0, //kA3DPDFInterpolateAppearanceColor,
|
||||
dColInitR, dColInitG, dColInitB,
|
||||
-1, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.1, // set 0.1 second but it could be any time before the end (just the previous keyframe counts)
|
||||
0, //kA3DPDFInterpolateAppearanceColor,
|
||||
-1,-1,-1, // RGB
|
||||
-1, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
}
|
||||
|
||||
if(! (dOpacInit == -1))
|
||||
{
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
0, //kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1,
|
||||
dOpacInit, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.1, // set 0.1 second but it could be any time before the end (just the previous keyframe counts)
|
||||
0, //kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1,
|
||||
dOpacInit, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
}
|
||||
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dTimeOffset;
|
||||
sMotionData.m_iNumTargets = idxTargets;
|
||||
sMotionData.m_ppTargets = ppTargets;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
dTimeDuration = 0.1;
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus CreateMotionFlash(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DMiscMarkupLinkedItem** ppTargets, int idxTargets,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
double dColBlinkR, double dColBlinkG, double dColBlinkB,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration)
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
const int INBKEYFRAMESALLOC = 10;
|
||||
A3DPDFAnimKeyFrame** ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame = 0;
|
||||
|
||||
// flash yellow to red
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
kA3DPDFInterpolateAppearanceColor ,
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
-1.0, // opacity
|
||||
eRenderingStyle ); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.16,
|
||||
kA3DPDFInterpolateAppearanceColor,
|
||||
dColBlinkR, dColBlinkG, dColBlinkB, // RGB
|
||||
-1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.32,
|
||||
kA3DPDFInterpolateAppearanceColor ,
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
-1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.49,
|
||||
kA3DPDFInterpolateAppearanceColor,
|
||||
dColBlinkR, dColBlinkG, dColBlinkB, // RGB
|
||||
-1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.66,
|
||||
kA3DPDFInterpolateAppearanceColor ,
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
-1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.83,
|
||||
kA3DPDFInterpolateAppearanceColor,
|
||||
dColBlinkR, dColBlinkG, dColBlinkB, // RGB
|
||||
-1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 1.00,
|
||||
0, //kA3DPDFInterpolateAppearanceColor ,
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
-1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dTimeOffset;
|
||||
sMotionData.m_iNumTargets = idxTargets;
|
||||
sMotionData.m_ppTargets = ppTargets;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
dTimeDuration = 1.0;
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
A3DStatus CreateMotionMoveRotateAndHide(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DMiscMarkupLinkedItem** ppTargets, int idxTargets,
|
||||
double dInitValueX, double dInitValueY, double dInitValueZ,
|
||||
double dApplyTranslateX, double dApplyTranslateY, double dApplyTranslateZ,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
bool bHide,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration)
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
const int INBKEYFRAMESALLOC = 20;
|
||||
A3DPDFAnimKeyFrame **ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame = 0;
|
||||
|
||||
// start with an identity transfo matrix ; it will be updated at each new frame
|
||||
double adMat[16];
|
||||
stLoadIdentityMatrix(adMat);
|
||||
|
||||
// init
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
adMat, // position matrix
|
||||
false,0,0,0,0, // no rotation
|
||||
dInitValueX, dInitValueY, dInitValueZ, // defines the initial position for this movement
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle ); // rendering style
|
||||
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 0.25,
|
||||
adMat, // position matrix
|
||||
true, 0.7071, 0, 0, 0.7071, // quaternion for the rotation
|
||||
dApplyTranslateX/4.0, dApplyTranslateY/4.0, dApplyTranslateZ/4.0, // defines the initial position for this movement
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 0.50,
|
||||
adMat, // position matrix
|
||||
true, 0.7071, 0, 0, 0.7071, // quaternion for the rotation
|
||||
dApplyTranslateX*2/4.0, dApplyTranslateY*2/4.0, dApplyTranslateZ*2/4.0, // defines the initial position for this movement
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 0.75,
|
||||
adMat, // position matrix
|
||||
true, 0.7071, 0, 0, 0.7071, // quaternion for the rotation
|
||||
dApplyTranslateX*3/4.0, dApplyTranslateY*3/4.0, dApplyTranslateZ*3/4.0, // defines the initial position for this movement
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 1.0,
|
||||
adMat, // position matrix
|
||||
true, 0.7071, 0, 0, 0.7071, // quaternion for the rotation
|
||||
dApplyTranslateX*4/4.0, dApplyTranslateY*4/4.0, dApplyTranslateZ*4/4.0, // defines the initial position for this movement
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle, // rendering style
|
||||
2); // no appearance mask
|
||||
|
||||
if(bHide)
|
||||
{
|
||||
// hide the objects init
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 1.5,
|
||||
kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle ); // rendering style
|
||||
|
||||
// hide the objects end
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 2.0,
|
||||
kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1, // RGB
|
||||
0.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
}
|
||||
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dTimeOffset;
|
||||
sMotionData.m_iNumTargets = idxTargets;
|
||||
sMotionData.m_ppTargets = ppTargets;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
|
||||
dTimeDuration = 2.0;
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
A3DStatus CreateMotionMoveAndHide(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DMiscMarkupLinkedItem** ppTargets, int idxTargets,
|
||||
double dInitValueX, double dInitValueY, double dInitValueZ,
|
||||
double dApplyTranslateX, double dApplyTranslateY, double dApplyTranslateZ,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
bool bHide,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration)
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
const int INBKEYFRAMESALLOC = 20;
|
||||
A3DPDFAnimKeyFrame **ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame = 0;
|
||||
|
||||
// start with an identity transfo matrix ; it will be updated at each new frame
|
||||
double adMat[16];
|
||||
stLoadIdentityMatrix(adMat);
|
||||
|
||||
// init
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
adMat, // position matrix
|
||||
false, 0, 0, 0, 0, // no rotation
|
||||
dInitValueX, dInitValueY, dInitValueZ, // defines the initial position for this movement
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
|
||||
// translated position
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 1.0,
|
||||
adMat,
|
||||
false, 0, 0, 0, 0, // no rotation
|
||||
dApplyTranslateX, dApplyTranslateY, dApplyTranslateZ, // apply this translation
|
||||
dColInitR, dColInitG, dColInitB, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle, // rendering style
|
||||
2); // no appearance mask
|
||||
|
||||
if(bHide)
|
||||
{
|
||||
// hide the objects init
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 1.5,
|
||||
kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1, // RGB
|
||||
1.0, // opacity
|
||||
eRenderingStyle ); // rendering style
|
||||
|
||||
// hide the objects end
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 2.0,
|
||||
kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1, // RGB
|
||||
0.0, // opacity
|
||||
eRenderingStyle); // rendering style
|
||||
}
|
||||
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dTimeOffset;
|
||||
sMotionData.m_iNumTargets = idxTargets;
|
||||
sMotionData.m_ppTargets = ppTargets;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
|
||||
dTimeDuration = 2.0;
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
A3DStatus CreateMotionMoveInitTransfo(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DMiscMarkupLinkedItem** ppTargets, int idxTargets,
|
||||
double dInitTranslateX, double dInitTranslateY, double dInitTranslateZ,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration)
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
const int INBKEYFRAMESALLOC = 20;
|
||||
A3DPDFAnimKeyFrame **ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame = 0;
|
||||
|
||||
// start with an identity transfo matrix ; it will be updated at each new frame
|
||||
double adMat[16];
|
||||
stLoadIdentityMatrix(adMat);
|
||||
|
||||
|
||||
// init
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
adMat, // position matrix
|
||||
false, 0, 0, 0, 0, // no rotation
|
||||
dInitTranslateX, dInitTranslateY, dInitTranslateZ,
|
||||
-1, -1, -1,
|
||||
1.0, // opacity
|
||||
kA3DPDFRenderingSolid, // rendering style
|
||||
2);// no mask
|
||||
|
||||
// translated position
|
||||
AddKeyFrameTransfo(ppKeyFrame, idxKeyFrame, 0.1, // 0.1 to be sure that the event is considered. smaller value as 0.05 is sometimes not considered.
|
||||
adMat,
|
||||
false, 0, 0, 0, 0, // no rotation
|
||||
dInitTranslateX, dInitTranslateY, dInitTranslateZ,
|
||||
-1, -1, -1,
|
||||
1.0, // opacity
|
||||
kA3DPDFRenderingSolid, // rendering style
|
||||
2);// no mask
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dTimeOffset;
|
||||
sMotionData.m_iNumTargets = idxTargets;
|
||||
sMotionData.m_ppTargets = ppTargets;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
|
||||
dTimeDuration = 0.1;
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void AddKeyFrameCamera(A3DPDFAnimKeyFrame**& ppKeyFrame, int& idxkeyframe,
|
||||
A3DDouble dTime,
|
||||
int /*iInterpolationMask*/,
|
||||
double dPosX, double dPosY, double dPosZ,
|
||||
double dTargetX, double dTargetY, double dTargetZ,
|
||||
double dUpX, double dUpY, double dUpZ,
|
||||
double dFov, A3DPDFEProjectionMode eMode, double dZoomFactor)
|
||||
//A3DPDFERenderingStyle eRenderingStyle)
|
||||
{
|
||||
A3DPDFAnimKeyFrame* pKeyFrame;
|
||||
A3DPDFAnimKeyFrameData sKeyFrameData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimKeyFrameData, sKeyFrameData);
|
||||
sKeyFrameData.m_dTime = dTime;
|
||||
sKeyFrameData.m_iInterpolationMask = kA3DPDFInterpolateCamera;
|
||||
|
||||
A3DPDFAnimCameraData sCameraData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimCameraData, sCameraData);
|
||||
|
||||
sCameraData.m_sPosition.m_dX = dPosX;
|
||||
sCameraData.m_sPosition.m_dY = dPosY;
|
||||
sCameraData.m_sPosition.m_dZ = dPosZ;
|
||||
|
||||
sCameraData.m_sTarget.m_dX = dTargetX;
|
||||
sCameraData.m_sTarget.m_dY = dTargetY;
|
||||
sCameraData.m_sTarget.m_dZ = dTargetZ;
|
||||
|
||||
sCameraData.m_sUpVector.m_dX = dUpX;
|
||||
sCameraData.m_sUpVector.m_dY = dUpY;
|
||||
sCameraData.m_sUpVector.m_dZ = dUpZ;
|
||||
|
||||
sCameraData.m_dFieldOfView = dFov;
|
||||
sCameraData.m_eMode = eMode;
|
||||
sCameraData.m_dZoomFactor = dZoomFactor;
|
||||
|
||||
sKeyFrameData.m_psCameraData = &sCameraData;
|
||||
|
||||
A3DPDFAnimKeyFrameCreate(&sKeyFrameData, &pKeyFrame);
|
||||
ppKeyFrame[idxkeyframe++] = pKeyFrame;
|
||||
}
|
||||
|
||||
|
||||
A3DStatus CreateMotionCameraInit(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
double dPosX0, double dPosY0, double dPosZ0,
|
||||
double dTargetX0, double dTargetY0, double dTargetZ0,
|
||||
double dUpX0, double dUpY0, double dUpZ0,
|
||||
double dFov0, A3DPDFEProjectionMode eMode0, double dZoomFactor0,
|
||||
double dPosX, double dPosY, double dPosZ,
|
||||
double dTargetX, double dTargetY, double dTargetZ,
|
||||
double dUpX, double dUpY, double dUpZ,
|
||||
double dFov, A3DPDFEProjectionMode eMode, double dZoomFactor,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration)
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
const int INBKEYFRAMESALLOC = 10;
|
||||
A3DPDFAnimKeyFrame** ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame=0;
|
||||
|
||||
AddKeyFrameCamera(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
0, //kA3DPDFInterpolateAppearanceColor,
|
||||
dPosX0, dPosY0, dPosZ0,
|
||||
dTargetX0, dTargetY0, dTargetZ0,
|
||||
dUpX0, dUpY0, dUpZ0,
|
||||
dFov0, eMode0, dZoomFactor0);
|
||||
AddKeyFrameCamera(ppKeyFrame, idxKeyFrame, 1.0, // set 1 second but it could be any time before the end (just the previous keyframe counts)
|
||||
0, //kA3DPDFInterpolateAppearanceColor,
|
||||
dPosX, dPosY, dPosZ,
|
||||
dTargetX, dTargetY, dTargetZ,
|
||||
dUpX, dUpY, dUpZ,
|
||||
dFov, eMode, dZoomFactor);
|
||||
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dTimeOffset;
|
||||
sMotionData.m_iNumTargets = 0;
|
||||
sMotionData.m_ppTargets = NULL;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
dTimeDuration = 1.0;
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
168
publish/publishsource/AnimWorkinstruction/AnimDef.hpp
Normal file
168
publish/publishsource/AnimWorkinstruction/AnimDef.hpp
Normal file
@@ -0,0 +1,168 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDef.hpp
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#ifndef __A3DANIMDEF_H__
|
||||
#define __A3DANIMDEF_H__
|
||||
|
||||
|
||||
#define HOOPS_PRODUCT_PUBLISH_ADVANCED
|
||||
#include <A3DSDKIncludes.h>
|
||||
#include "../common.hpp"
|
||||
|
||||
void AddKeyFrameAppearance(A3DPDFAnimKeyFrame**& ppKeyFrame, int& idxkeyframe,
|
||||
A3DDouble dTime,
|
||||
int iInterpolationMask,
|
||||
double dR, double dG, double dB,
|
||||
double dOpacity,
|
||||
A3DPDFERenderingStyle eRenderingStyle);
|
||||
|
||||
|
||||
A3DStatus CreateMotionAppearInit(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DPDFTargetEntity** ppTargets, int idxTargets,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
double dOpacInit,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
A3DStatus CreateMotionFlash(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DPDFTargetEntity** ppTargets, int idxTarget,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
double dColBlinkR, double dColBlinkG, double dColBlinkB,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
|
||||
A3DStatus CreateMoveBackward(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DPDFTargetEntity** ppTargets, int idxTargets,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
A3DStatus CreateMotionMoveAndHide(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DPDFTargetEntity** ppTargets, int idxTargets,
|
||||
double dInitValueX, double dInitValueY, double dInitValueZ,
|
||||
double dApplyTranslateValueX, double dApplyTranslateY, double dApplyTranslateZ,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
bool bHide,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
A3DStatus CreateMotionMoveRotateAndHide(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DPDFTargetEntity** ppTargets, int idxTargets,
|
||||
double dInitValueX, double dInitValueY, double dInitValueZ,
|
||||
double dApplyTranslateValueX, double dApplyTranslateY, double dApplyTranslateZ,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
bool bHide,
|
||||
A3DPDFERenderingStyle eRenderingStyle,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
|
||||
A3DStatus CreateMotionMoveInitTransfo(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DPDFTargetEntity** ppTargets, int idxTargets,
|
||||
double dApplyTranslateX, double dApplyTranslateY, double dApplyTranslateZ,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
A3DStatus CreateMoveTranslationBackward(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
A3DPDFTargetEntity** ppTargets, int idxTargets,
|
||||
double dApplyTranslateX, double dApplyTranslateY, double dApplyTranslateZ,
|
||||
double dColInitR, double dColInitG, double dColInitB,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
A3DStatus CreateMotionCameraInit(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
double dPosX0, double dPosY0, double dPosZ0,
|
||||
double dTargetX0, double dTargetY0, double dTargetZ0,
|
||||
double dUpX0, double dUpY0, double dUpZ0,
|
||||
double dFov0, A3DPDFEProjectionMode eMode0, double dZoomFactor0,
|
||||
double dPosX, double dPosY, double dPosZ,
|
||||
double dTargetX, double dTargetY, double dTargetZ,
|
||||
double dUpX, double dUpY, double dUpZ,
|
||||
double dFov, A3DPDFEProjectionMode eMode, double dZoomFactor,
|
||||
double dTimeOffset,
|
||||
double& dTimeDuration);
|
||||
|
||||
A3DStatus CreateMotionsInitState(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
int iMaxStep,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration);
|
||||
|
||||
A3DStatus CreateView(A3DPDFDocument* pDoc, A3DPDF3DArtwork* p3DArtwork,
|
||||
A3DDouble dPosX, A3DDouble dPosY, A3DDouble dPosZ,
|
||||
A3DDouble dTargetX, A3DDouble dTargetY, A3DDouble dTargetZ,
|
||||
A3DDouble dUpX, A3DDouble dUpY, A3DDouble dUpZ,
|
||||
A3DPDFEProjectionMode eProjectionMode,
|
||||
A3DDouble dZoomFactor, A3DDouble dFieldOfView,
|
||||
A3DBool bIsDefault, const A3DUTF8Char* pcViewName,
|
||||
A3DPDFView** ppView);
|
||||
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
// GLOBAL VARIABLES
|
||||
|
||||
#ifdef DEFINE_TARGETS_GLOBALS
|
||||
#define EXTERN
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsWasher;
|
||||
EXTERN int idxTargetsWasher;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsAllModel;
|
||||
EXTERN int idxTargetsAllModel;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsAllExceptWasher;
|
||||
EXTERN int idxTargetsAllExceptWasher;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsScrew1;
|
||||
EXTERN int idxTargetsScrew1;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsScrew2To4;
|
||||
EXTERN int idxTargetsScrew2To4;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsCarbu;
|
||||
EXTERN int idxTargetsCarbu;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsHousingFront;
|
||||
EXTERN int idxTargetsHousingFront;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsCasingFront;
|
||||
EXTERN int idxTargetsCasingFront;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsScrews;
|
||||
EXTERN int idxTargetsScrews;
|
||||
|
||||
EXTERN A3DPDFTargetEntity** ppTargetsMobilePart;
|
||||
EXTERN int idxTargetsMobilePart;
|
||||
|
||||
#define PAUSE1SEC 1.0
|
||||
#define PAUSEDEMISEC 0.5
|
||||
|
||||
A3DStatus BuildAnimationStep1(A3DPDFAnimation **ppAnim, double dTimeOffset, double& dTimeDuration);
|
||||
A3DStatus BuildAnimationStep2(A3DPDFAnimation **ppAnim, double dTimeOffset, double& dTimeDuration);
|
||||
A3DStatus BuildAnimationStep3(A3DPDFAnimation **ppAnim, double dTimeOffset, double& dTimeDuration);
|
||||
A3DStatus BuildAnimationStep4(A3DPDFAnimation **ppAnim, double dTimeOffset, double& dTimeDuration);
|
||||
A3DStatus BuildAnimationStep5(A3DPDFAnimation **ppAnim, double dTimeOffset, double& dTimeDuration);
|
||||
A3DStatus BuildAnimationStep6(A3DPDFAnimation **ppAnim, double dTimeOffset, double& dTimeDuration);
|
||||
A3DStatus BuildAnimationStep7(A3DPDFAnimation **ppAnim, double dTimeOffset, double& dTimeDuration);
|
||||
|
||||
void CreateAllTargetsSet(A3DAsmModelFile* pModelFile);
|
||||
|
||||
#endif /* __A3DANIMDEF_H__ */
|
||||
178
publish/publishsource/AnimWorkinstruction/AnimDefStep1.cpp
Normal file
178
publish/publishsource/AnimWorkinstruction/AnimDefStep1.cpp
Normal file
@@ -0,0 +1,178 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStep1.cpp
|
||||
|
||||
Animation for Step 1
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
|
||||
/*
|
||||
Zoom to full extent of the model.
|
||||
Make all parts of the model go semi-transparent with the exception of the washer.
|
||||
then flash the color of the washer to yellow three times over one second.
|
||||
Pause one second
|
||||
and then make the model turn back opaque over one second.
|
||||
*/
|
||||
A3DStatus BuildAnimationStep1(A3DPDFAnimation **ppAnim,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// ANIMATION = set of MOTIONS
|
||||
const int INBMOTIONS = 20;
|
||||
A3DPDFAnimMotion** ppMotion;
|
||||
ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*)));
|
||||
int idxMotion = 0;
|
||||
double dInitTimeOffset = dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
CreateMotionsInitState(ppMotion, idxMotion, 1,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION CAMERA
|
||||
CreateMotionCameraInit(ppMotion, idxMotion,
|
||||
334.117035, 243.555069, 101.844193,
|
||||
45.135365, 43.723457, -33.948994,
|
||||
-0.311321, -0.183419, 0.932440,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*106),
|
||||
240.637375, -170.123276, 153.468277,
|
||||
42.014103, 28.500000, -45.155003,
|
||||
-0.408250, 0.408250, 0.816500,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*137),
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 1
|
||||
// Make all parts of the model go semi-transparent with the exception of the washer.
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
const int INBKEYFRAMESALLOC = 10;
|
||||
A3DPDFAnimKeyFrame** ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame = 0;
|
||||
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1, // RGB
|
||||
1.0, // opacity
|
||||
kA3DPDFRenderingSolid ); // rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 1.0,
|
||||
0,//kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1, // RGB
|
||||
0.1, // opacity
|
||||
kA3DPDFRenderingSolid );// rendering style
|
||||
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dInitTimeOffset;
|
||||
sMotionData.m_iNumTargets = idxTargetsAllExceptWasher;
|
||||
sMotionData.m_ppTargets = ppTargetsAllExceptWasher;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
|
||||
dTimeDuration = 1.0; // 1 second motion
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
// MOTION 2
|
||||
// then flash the color of the washer to yellow three times over one second.
|
||||
CreateMotionFlash(ppMotion, idxMotion,
|
||||
ppTargetsWasher, idxTargetsWasher,
|
||||
1, 1, 0, // color init
|
||||
1, 0, 0, // color blink
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 3
|
||||
// Pause one second
|
||||
// and then make the model turn back opaque over one second.
|
||||
{
|
||||
A3DPDFAnimMotion* pMotion;
|
||||
A3DPDFAnimMotionData2 sMotionData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimMotionData2, sMotionData);
|
||||
|
||||
// --- KEYFRAMES
|
||||
|
||||
// pause 1 second
|
||||
dInitTimeOffset += PAUSE1SEC;
|
||||
|
||||
const int INBKEYFRAMESALLOC = 10;
|
||||
A3DPDFAnimKeyFrame** ppKeyFrame;
|
||||
ppKeyFrame = (A3DPDFAnimKeyFrame**) malloc(INBKEYFRAMESALLOC * A3DUns32(sizeof(A3DPDFAnimKeyFrame*)));
|
||||
int idxKeyFrame = 0;
|
||||
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 0.0,
|
||||
kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1, -1, -1, // RGB
|
||||
0.1, // opacity
|
||||
kA3DPDFRenderingSolid);// rendering style
|
||||
AddKeyFrameAppearance(ppKeyFrame, idxKeyFrame, 1.0,
|
||||
0,//kA3DPDFInterpolateAppearanceTransparency,
|
||||
-1,-1,-1, // RGB
|
||||
0.1, // opacity
|
||||
kA3DPDFRenderingSolid);// rendering style
|
||||
|
||||
|
||||
// --- MOTION CREATION
|
||||
|
||||
sMotionData.m_bRepeat = false;
|
||||
sMotionData.m_dTimeOffset = dInitTimeOffset;
|
||||
sMotionData.m_iNumTargets = idxTargetsAllExceptWasher;
|
||||
sMotionData.m_ppTargets = ppTargetsAllExceptWasher;
|
||||
sMotionData.m_iNumKeyFrames = idxKeyFrame;
|
||||
sMotionData.m_ppKeyFrames = ppKeyFrame;
|
||||
|
||||
A3DPDFAnimMotionCreate2(&sMotionData, &pMotion);
|
||||
ppMotion[idxMotion++] = pMotion;
|
||||
|
||||
dTimeDuration = 1.0; // 1 second motion
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
// --- ANIMATION CREATION
|
||||
A3DPDFAnimationData sAnimationData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData);
|
||||
sAnimationData.m_pcName = const_cast<A3DUTF8Char*>("step1");
|
||||
sAnimationData.m_iFramesPerSecond = 20;
|
||||
sAnimationData.m_iNumAnimationMotions = idxMotion;
|
||||
sAnimationData.m_ppAnimationMotions = ppMotion;
|
||||
|
||||
iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim);
|
||||
return iRet;
|
||||
}
|
||||
133
publish/publishsource/AnimWorkinstruction/AnimDefStep2.cpp
Normal file
133
publish/publishsource/AnimWorkinstruction/AnimDefStep2.cpp
Normal file
@@ -0,0 +1,133 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStep2.cpp
|
||||
|
||||
Animation for Step 2
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
/*
|
||||
Zoom to back of engine.
|
||||
Pause 1seconds.
|
||||
Flash the color of one screw to yellow three times over one second.
|
||||
Pause 0.5 seconds
|
||||
and then remove the screw out backwards.
|
||||
When it is out make it disappear by turning it fully transparent.
|
||||
Pause 1 second
|
||||
now repeat flash three times
|
||||
and remove for the other three screws as we did with the first screw.
|
||||
*/
|
||||
A3DStatus BuildAnimationStep2(A3DPDFAnimation **ppAnim,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// ANIMATION = set of MOTIONS
|
||||
const int INBMOTIONS = 20;
|
||||
A3DPDFAnimMotion** ppMotion;
|
||||
ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*)));
|
||||
int idxMotion = 0;
|
||||
double dInitTimeOffset = dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
CreateMotionsInitState(ppMotion, idxMotion, 2,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION CAMERA
|
||||
CreateMotionCameraInit(ppMotion, idxMotion,
|
||||
240.637375, -170.123276, 153.468277,
|
||||
42.014103, 28.500000, -45.155003,
|
||||
-0.408250, 0.408250, 0.816500,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*137),
|
||||
-1153.480469, -337.387329, 307.219879,
|
||||
47.379890, 29.873722, -48.658806,
|
||||
0.254603, 0.099596, 0.961904,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*160),
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 1
|
||||
// Flash the color of one screw to yellow three times over one second.
|
||||
CreateMotionFlash(ppMotion, idxMotion,
|
||||
ppTargetsScrew1, idxTargetsScrew1,
|
||||
1, 0, 0, // color init
|
||||
1, 1, 0, // color blink
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 2
|
||||
// remove the screw out backwards. When it is out make it disappear by turning it fully transparent.
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsScrew1, idxTargetsScrew1,
|
||||
0.0, 0.0, 0.0, // init pos
|
||||
-80.0, 0.0, 0.0, // translation to apply
|
||||
1, 0, 0, // color init
|
||||
true, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 3
|
||||
// repeat with other screws
|
||||
// Flash the color to yellow three times over one second.
|
||||
CreateMotionFlash(ppMotion, idxMotion,
|
||||
ppTargetsScrew2To4, idxTargetsScrew2To4,
|
||||
1, 0, 0, // color init
|
||||
1, 1, 0, // color blink
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 4
|
||||
// repeat with other screws
|
||||
// remove the screw out backwards. When it is out make it disappear by turning it fully transparent.
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsScrew2To4, idxTargetsScrew2To4,
|
||||
0.0, 0.0, 0.0, // init pos
|
||||
-80.0, 0.0, 0.0, // translation to apply
|
||||
1, 0, 0, // color init
|
||||
true, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
// --- ANIMATION CREATION
|
||||
A3DPDFAnimationData sAnimationData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData);
|
||||
sAnimationData.m_pcName = const_cast<A3DUTF8Char*>("step2");
|
||||
sAnimationData.m_iFramesPerSecond = 20;
|
||||
sAnimationData.m_iNumAnimationMotions = idxMotion;
|
||||
sAnimationData.m_ppAnimationMotions = ppMotion;
|
||||
|
||||
iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim);
|
||||
return iRet;
|
||||
}
|
||||
103
publish/publishsource/AnimWorkinstruction/AnimDefStep3.cpp
Normal file
103
publish/publishsource/AnimWorkinstruction/AnimDefStep3.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStep3.cpp
|
||||
|
||||
Animation for Step 3
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
/*
|
||||
Orbit back to the front of the micro engine
|
||||
Pause 1 second.
|
||||
Flash the color of the mini-housing to yellow three times over one second.
|
||||
Pause 0.5 seconds and then remove the mini housing unit.
|
||||
*/
|
||||
A3DStatus BuildAnimationStep3(A3DPDFAnimation **ppAnim,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// ANIMATION = set of MOTIONS
|
||||
const int INBMOTIONS = 20;
|
||||
A3DPDFAnimMotion** ppMotion;
|
||||
ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*)));
|
||||
int idxMotion = 0;
|
||||
double dInitTimeOffset = dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
CreateMotionsInitState(ppMotion, idxMotion, 3,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION CAMERA
|
||||
CreateMotionCameraInit(ppMotion, idxMotion,
|
||||
-1153.480469, -337.387329, 307.219879,
|
||||
47.379890, 29.873722, -48.658806,
|
||||
0.254603, 0.099596, 0.961904,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*160),
|
||||
143.727493, -160.918030, -101.847794,
|
||||
44.578068, 19.042654, -51.351418,
|
||||
0.875282, 0.410491, 0.255690,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*59),
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 1
|
||||
// Flash the color of mini-housing to yellow three times over one second.
|
||||
CreateMotionFlash(ppMotion, idxMotion,
|
||||
ppTargetsCarbu, idxTargetsCarbu,
|
||||
128.0/255.0, 255.0/255.0, 255.0/255.0, // color init
|
||||
1, 1, 0, // color blink
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 2
|
||||
// Pause 0.5 seconds and then remove the mini housing unit.
|
||||
dInitTimeOffset += PAUSEDEMISEC;
|
||||
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsCarbu, idxTargetsCarbu,
|
||||
0.0, 0.0, 0.0, // init pos
|
||||
0.0, 0.0, -40.0, // translation to apply
|
||||
128.0/255.0, 255.0/255.0, 255.0/255.0, // color init
|
||||
true, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
// --- ANIMATION CREATION
|
||||
A3DPDFAnimationData sAnimationData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData);
|
||||
sAnimationData.m_pcName = const_cast<A3DUTF8Char*>("step3");
|
||||
sAnimationData.m_iFramesPerSecond = 20;
|
||||
sAnimationData.m_iNumAnimationMotions = idxMotion;
|
||||
sAnimationData.m_ppAnimationMotions = ppMotion;
|
||||
|
||||
iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim);
|
||||
return iRet;
|
||||
}
|
||||
103
publish/publishsource/AnimWorkinstruction/AnimDefStep4.cpp
Normal file
103
publish/publishsource/AnimWorkinstruction/AnimDefStep4.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStep4.cpp
|
||||
|
||||
Animation for Step 4
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
/*
|
||||
Orbit back to the front of the micro engine
|
||||
Pause 1 second.
|
||||
Change color of the front casing from original color to yellow three times over one second.
|
||||
Pause 0.5 seconds and then remove the casing
|
||||
*/
|
||||
A3DStatus BuildAnimationStep4(A3DPDFAnimation **ppAnim,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// ANIMATION = set of MOTIONS
|
||||
const int INBMOTIONS = 20;
|
||||
A3DPDFAnimMotion** ppMotion;
|
||||
ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*)));
|
||||
int idxMotion = 0;
|
||||
double dInitTimeOffset = dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
CreateMotionsInitState(ppMotion, idxMotion, 4,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION CAMERA
|
||||
CreateMotionCameraInit(ppMotion, idxMotion,
|
||||
143.727493, -160.918030, -101.847794,
|
||||
44.578068, 19.042654, -51.351418,
|
||||
0.875282, 0.410491, 0.255690,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*59),
|
||||
365.935852, 286.484344, 218.981415,
|
||||
14.348255, 10.195333, -58.078251,
|
||||
-0.390901, -0.354405, 0.849470,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*149),
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 1
|
||||
// Flash the color of the front casing to yellow three times over one second.
|
||||
CreateMotionFlash(ppMotion, idxMotion,
|
||||
ppTargetsHousingFront, idxTargetsHousingFront,
|
||||
54.0/255.0, 188.0/255.0, 252.0/255.0, // color init
|
||||
1, 1, 0, // color blink
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 2
|
||||
// Pause 0.5 seconds and then remove the front casing.
|
||||
dInitTimeOffset += PAUSEDEMISEC;
|
||||
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsHousingFront, idxTargetsHousingFront,
|
||||
0.0, 0.0, 0.0, // init pos
|
||||
+80.0, 0.0, 0.0, // translation to apply
|
||||
54.0/255.0, 188.0/255.0, 252.0/255.0, // color init
|
||||
true, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
// --- ANIMATION CREATION
|
||||
A3DPDFAnimationData sAnimationData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData);
|
||||
sAnimationData.m_pcName = const_cast<A3DUTF8Char*>("step4");
|
||||
sAnimationData.m_iFramesPerSecond = 20;
|
||||
sAnimationData.m_iNumAnimationMotions = idxMotion;
|
||||
sAnimationData.m_ppAnimationMotions = ppMotion;
|
||||
|
||||
iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim);
|
||||
return iRet;
|
||||
}
|
||||
103
publish/publishsource/AnimWorkinstruction/AnimDefStep5.cpp
Normal file
103
publish/publishsource/AnimWorkinstruction/AnimDefStep5.cpp
Normal file
@@ -0,0 +1,103 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStep5.cpp
|
||||
|
||||
Animation for Step 5
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
/*
|
||||
Orbit back to the front of the micro engine
|
||||
Pause 1 second.
|
||||
Change color of the pump jet from original color to yellow three times over one second.
|
||||
Pause 0.5 seconds and then remove the casing
|
||||
*/
|
||||
A3DStatus BuildAnimationStep5(A3DPDFAnimation **ppAnim,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// ANIMATION = set of MOTIONS
|
||||
const int INBMOTIONS = 20;
|
||||
A3DPDFAnimMotion** ppMotion;
|
||||
ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*)));
|
||||
int idxMotion = 0;
|
||||
double dInitTimeOffset=dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
CreateMotionsInitState(ppMotion, idxMotion, 5,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION CAMERA
|
||||
CreateMotionCameraInit(ppMotion, idxMotion,
|
||||
365.935852, 286.484344, 218.981415,
|
||||
14.348255, 10.195333, -58.078251,
|
||||
-0.390901, -0.354405, 0.849470,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*149),
|
||||
407.025665, 316.211060, 244.481506,
|
||||
17.669889, 10.242504, -62.340408,
|
||||
-0.390901, -0.354405, 0.849471,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*164),
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 1
|
||||
// Flash the color of pump jet to yellow three times over one second.
|
||||
CreateMotionFlash(ppMotion, idxMotion,
|
||||
ppTargetsCasingFront, idxTargetsCasingFront,
|
||||
0.0, 1.0, 0.0, // color init
|
||||
1,1,0, // color blink
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 2
|
||||
// Pause 0.5 seconds and then remove the pump jet.
|
||||
dInitTimeOffset += PAUSEDEMISEC;
|
||||
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsCasingFront, idxTargetsCasingFront,
|
||||
0.0, 0.0, 0.0, // init pos
|
||||
0.0, +80.0, 0.0, // translation to apply
|
||||
0.0, 1.0, 0.0, // color init
|
||||
true, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
// --- ANIMATION CREATION
|
||||
A3DPDFAnimationData sAnimationData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData);
|
||||
sAnimationData.m_pcName = const_cast<A3DUTF8Char*>("step5");
|
||||
sAnimationData.m_iFramesPerSecond = 20;
|
||||
sAnimationData.m_iNumAnimationMotions = idxMotion;
|
||||
sAnimationData.m_ppAnimationMotions = ppMotion;
|
||||
|
||||
iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim);
|
||||
return iRet;
|
||||
}
|
||||
122
publish/publishsource/AnimWorkinstruction/AnimDefStep6.cpp
Normal file
122
publish/publishsource/AnimWorkinstruction/AnimDefStep6.cpp
Normal file
@@ -0,0 +1,122 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStep6.cpp
|
||||
|
||||
Animation for Step 6
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
/*
|
||||
Zoom in to washer
|
||||
Pause 1 second.
|
||||
Flash the color of the front casing from original color to yellow three times over one second.
|
||||
Pause 0.5 seconds
|
||||
and then remove the washer and have it disappear.
|
||||
Now bring in a new washer which is a different color.
|
||||
*/
|
||||
A3DStatus BuildAnimationStep6(A3DPDFAnimation **ppAnim,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// ANIMATION = set of MOTIONS
|
||||
const int INBMOTIONS = 20;
|
||||
A3DPDFAnimMotion** ppMotion;
|
||||
ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*)));
|
||||
int idxMotion = 0;
|
||||
double dInitTimeOffset = dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
CreateMotionsInitState(ppMotion, idxMotion, 6,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION CAMERA
|
||||
CreateMotionCameraInit(ppMotion, idxMotion,
|
||||
407.025665, 316.211060, 244.481506,
|
||||
17.669889, 10.242504, -62.340408,
|
||||
-0.390901, -0.354405, 0.849471,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*164),
|
||||
121.631744, 65.543808, -3.716970,
|
||||
30.948513, 27.898954, -16.392185,
|
||||
-0.099281, -0.094375, 0.990579,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*28),
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 1
|
||||
// Flash the color of the washer from original color to yellow three times over one second.
|
||||
CreateMotionFlash(ppMotion, idxMotion,
|
||||
ppTargetsWasher, idxTargetsWasher,
|
||||
1, 1, 0, // color init
|
||||
1, 0, 0, // color blink
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 2
|
||||
// Pause 0.5 seconds and then remove the washer
|
||||
// pause 0.5 seconds
|
||||
dInitTimeOffset += PAUSEDEMISEC;
|
||||
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsWasher, idxTargetsWasher,
|
||||
0.0, 0.0, 0.0, // init pos
|
||||
0.0, -80.0, 0.0, // translation to apply
|
||||
1,1,0, // color init
|
||||
true, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 3
|
||||
// Now bring in a new washer which is a different color.
|
||||
// pause 0.5 seconds
|
||||
dInitTimeOffset += PAUSE1SEC;
|
||||
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsWasher, idxTargetsWasher,
|
||||
0.0, -80.0, 0.0, // init pos
|
||||
0.0, +80.0, 0.0, // translation to apply
|
||||
1,0,1, // color init
|
||||
false, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
// --- ANIMATION CREATION
|
||||
A3DPDFAnimationData sAnimationData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData);
|
||||
sAnimationData.m_pcName = const_cast<A3DUTF8Char*>("step6");
|
||||
sAnimationData.m_iFramesPerSecond = 20;
|
||||
sAnimationData.m_iNumAnimationMotions = idxMotion;
|
||||
sAnimationData.m_ppAnimationMotions = ppMotion;
|
||||
|
||||
iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim);
|
||||
return iRet;
|
||||
}
|
||||
128
publish/publishsource/AnimWorkinstruction/AnimDefStep7.cpp
Normal file
128
publish/publishsource/AnimWorkinstruction/AnimDefStep7.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStep7.cpp
|
||||
|
||||
Animation for Step 7
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
/*
|
||||
Zoom out to extent and pause 1 second.
|
||||
Then one by one bring each object back in.
|
||||
*/
|
||||
A3DStatus BuildAnimationStep7(A3DPDFAnimation **ppAnim,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// ANIMATION = set of MOTIONS
|
||||
const int INBMOTIONS = 20;
|
||||
A3DPDFAnimMotion** ppMotion;
|
||||
ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*)));
|
||||
int idxMotion = 0;
|
||||
double dInitTimeOffset = dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
CreateMotionsInitState(ppMotion, idxMotion, 7,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION CAMERA
|
||||
CreateMotionCameraInit(ppMotion, idxMotion,
|
||||
121.631744, 65.543808, -3.716970,
|
||||
30.948513, 27.898954, -16.392185,
|
||||
-0.099281, -0.094375, 0.990579,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*28),
|
||||
334.117035, 243.555069, 101.844193,
|
||||
45.135365, 43.723457, -33.948994,
|
||||
-0.311321, -0.183419, 0.932440,
|
||||
10, kA3DPDFOrthographicMode, 1.0/(2*106),
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
// MOTION 1
|
||||
// bring front casing back in (see Step 5)
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsCasingFront, idxTargetsCasingFront,
|
||||
0.0, +80.0, 0.0, // init pos
|
||||
0.0, -80.0, 0.0, // translation to apply
|
||||
0.0, 1.0, 0.0, // color init
|
||||
false, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 2
|
||||
// bring housing front back in (see Step 4)
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsHousingFront, idxTargetsHousingFront,
|
||||
+80.0, 0.0, 0.0, // init pos
|
||||
-80.0, 0.0, 0.0, // translation to apply
|
||||
54.0/255.0, 188.0/255.0, 252.0/255.0, // color init
|
||||
false, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 3
|
||||
// bring carbu back in (see Step 3)
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsCarbu, idxTargetsCarbu,
|
||||
0.0, 0.0, -40.0, // init pos
|
||||
0.0, 0.0, +40.0, // translation to apply
|
||||
128.0/255.0, 255.0/255.0, 255.0/255.0, // color init
|
||||
false, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// MOTION 4
|
||||
// bring the 4 screws back in (see Step 2)
|
||||
//CreateMoveBackward to have the rotation with the movement
|
||||
CreateMotionMoveAndHide(ppMotion, idxMotion,
|
||||
ppTargetsScrews, idxTargetsScrews,
|
||||
-80.0, 0.0, 0.0, // init pos
|
||||
+80.0, 0.0, 0.0, // translation to apply
|
||||
1,0,0, // color init
|
||||
false, //bHide
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
dInitTimeOffset += dTimeDuration;
|
||||
|
||||
|
||||
dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
// --- ANIMATION CREATION
|
||||
A3DPDFAnimationData sAnimationData;
|
||||
A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData);
|
||||
sAnimationData.m_pcName = const_cast<A3DUTF8Char*>("step7");
|
||||
sAnimationData.m_iFramesPerSecond = 20;
|
||||
sAnimationData.m_iNumAnimationMotions = idxMotion;
|
||||
sAnimationData.m_ppAnimationMotions = ppMotion;
|
||||
|
||||
iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim);
|
||||
return iRet;
|
||||
}
|
||||
189
publish/publishsource/AnimWorkinstruction/AnimDefStepInits.cpp
Normal file
189
publish/publishsource/AnimWorkinstruction/AnimDefStepInits.cpp
Normal file
@@ -0,0 +1,189 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefStepInits.cpp
|
||||
|
||||
Definition of motions for initial states of all animations (=steps here)
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
/*
|
||||
handling init states: we must be able to replay each step at any moment. This means that each step must start with the
|
||||
good init state, always restored. This init state is inherited from past steps.
|
||||
*/
|
||||
A3DStatus CreateMotionsInitState(A3DPDFAnimMotion**& ppMotion, int& idxMotion,
|
||||
int iMaxStep,
|
||||
double dStepInitTimeOffset,
|
||||
double& dStepTimeDuration)
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
double dInitTimeOffset=dStepInitTimeOffset;
|
||||
double dTimeDuration;
|
||||
|
||||
// MOTIONS to specify init state
|
||||
// Step 0 = all at init pos; all visible
|
||||
if(iMaxStep >= 1)
|
||||
{
|
||||
CreateMotionMoveInitTransfo(ppMotion, idxMotion,
|
||||
ppTargetsAllModel, idxTargetsAllModel,
|
||||
0.0, 0.0, 0.0, // translation to set to the matrix
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// reset opacity : all visibles
|
||||
CreateMotionAppearInit(ppMotion, idxMotion,
|
||||
ppTargetsAllModel, idxTargetsAllModel,
|
||||
-1,-1,-1, // color init
|
||||
1.0,
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// reset washer color to initial color
|
||||
CreateMotionAppearInit(ppMotion, idxMotion,
|
||||
ppTargetsWasher, idxTargetsWasher,
|
||||
1, 1, 0, // color init
|
||||
-1,
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
// MOTIONS to specify init state
|
||||
// End Step 1 = same ending state as init
|
||||
if(iMaxStep >= 2)
|
||||
{
|
||||
}
|
||||
|
||||
// End Step 2 = all screws translated and hidden
|
||||
if(iMaxStep >= 3)
|
||||
{
|
||||
CreateMotionMoveInitTransfo(ppMotion, idxMotion,
|
||||
ppTargetsScrews, idxTargetsScrews,
|
||||
-80.0, 0.0, 0.0, // translation to set to the matrix
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// reset opacity
|
||||
CreateMotionAppearInit(ppMotion, idxMotion,
|
||||
ppTargetsScrews, idxTargetsScrews,
|
||||
-1, -1, -1, // color init
|
||||
0.0,
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
// End Step 3 = carbu translated and hidden
|
||||
if(iMaxStep >= 4)
|
||||
{
|
||||
CreateMotionMoveInitTransfo(ppMotion, idxMotion,
|
||||
ppTargetsCarbu, idxTargetsCarbu,
|
||||
0.0, 0.0, -40.0, // translation to set to the matrix
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// reset opacity
|
||||
CreateMotionAppearInit(ppMotion, idxMotion,
|
||||
ppTargetsCarbu, idxTargetsCarbu,
|
||||
-1, -1, -1, // color init
|
||||
0.0,
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
// End Step 4 = hfront translated and hidden
|
||||
if(iMaxStep >= 5)
|
||||
{
|
||||
CreateMotionMoveInitTransfo(ppMotion, idxMotion,
|
||||
ppTargetsHousingFront, idxTargetsHousingFront,
|
||||
+80.0, 0.0, 0.0, // translation to set to the matrix
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// reset opacity
|
||||
CreateMotionAppearInit(ppMotion, idxMotion,
|
||||
ppTargetsHousingFront, idxTargetsHousingFront,
|
||||
-1, -1, -1, // color init
|
||||
0.0,
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
// End Step 5 = casingfront translated and hidden
|
||||
if(iMaxStep >= 6)
|
||||
{
|
||||
CreateMotionMoveInitTransfo(ppMotion, idxMotion,
|
||||
ppTargetsCasingFront, idxTargetsCasingFront,
|
||||
0.0, +80.0, 0.0, // translation to set to the matrix
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
|
||||
// reset opacity
|
||||
CreateMotionAppearInit(ppMotion, idxMotion,
|
||||
ppTargetsCasingFront, idxTargetsCasingFront,
|
||||
-1, -1, -1, // color init
|
||||
0.0,
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
// End Step 6 = washer replaced with new color
|
||||
if(iMaxStep >= 7)
|
||||
{
|
||||
// reset washer color to initial color
|
||||
CreateMotionAppearInit(ppMotion, idxMotion,
|
||||
ppTargetsWasher, idxTargetsWasher,
|
||||
1, 0, 1, // color init
|
||||
-1,
|
||||
kA3DPDFRenderingSolid,
|
||||
dInitTimeOffset,
|
||||
dTimeDuration);
|
||||
// DO NOT change the init time (we just want to define the initial state)
|
||||
//dInitTimeOffset += dTimeDuration;
|
||||
}
|
||||
|
||||
// we need to play all these motions simultaneously
|
||||
dStepTimeDuration = 0.5;
|
||||
//dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset;
|
||||
|
||||
return iRet;
|
||||
}
|
||||
157
publish/publishsource/AnimWorkinstruction/AnimDefTargets.cpp
Normal file
157
publish/publishsource/AnimWorkinstruction/AnimDefTargets.cpp
Normal file
@@ -0,0 +1,157 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimDefTargets.cpp
|
||||
|
||||
Shared definition of all different set of targets used in all animations
|
||||
***********************************************************************************************************************/
|
||||
|
||||
// Do not define INITIALIZE_A3D_API here. It should be only included once in a project.
|
||||
#define DEFINE_TARGETS_GLOBALS
|
||||
#include "AnimDef.hpp"
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
|
||||
|
||||
A3DStatus AddTarget(A3DPDFTargetEntity**& ppTargets, int& idxTarget,
|
||||
A3DAsmModelFile* pModelFile, A3DUTF8Char *pcName, int iIndexRepItem)
|
||||
{
|
||||
A3DPDFTargetEntity*** ppTargetEntities;
|
||||
A3DInt32 *piSizes;
|
||||
A3DUTF8Char *apcNames[1];
|
||||
apcNames[0] = pcName;
|
||||
A3DInt32 aiIndexes[1];
|
||||
aiIndexes[0] = iIndexRepItem;
|
||||
A3DPDFGetEntitiesFromName(pModelFile, (A3DInt32)1, apcNames, aiIndexes, &ppTargetEntities, &piSizes);
|
||||
if (piSizes==0)
|
||||
return A3D_ERROR;
|
||||
|
||||
if (ppTargetEntities[0] != NULL)
|
||||
ppTargets[idxTarget++]=ppTargetEntities[0][0];
|
||||
else
|
||||
return A3D_ERROR;
|
||||
|
||||
return A3D_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void CreateAllTargetsSet(A3DAsmModelFile* pModelFile)
|
||||
{
|
||||
// --- TARGETS SET - All but earing PR DW
|
||||
const int INBTARGETSALLOC = 25;
|
||||
ppTargetsAllExceptWasher = (A3DPDFTargetEntity**) malloc(INBTARGETSALLOC * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
memset(ppTargetsAllExceptWasher, 0, sizeof(A3DPDFTargetEntity*) * INBTARGETSALLOC);
|
||||
|
||||
idxTargetsAllExceptWasher=0;
|
||||
// we specify 0 as index to get the first son of the productoccurence entity specified by its name
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "HOUSING(HOUSING.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "CYLINDER LINER(CYLINDER LINER.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "HOUSING TOP(HOUSING TOP.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "PUSH ROD(PUSH ROD.1)", 0);
|
||||
//AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "BEARING PR DW(BEARING PR DW.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "BEARING PR UP(BEARING PR UP.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "AXE(AXE.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "PISTON(PISTON.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "CRANKSHAFT(CRANKSHAFT.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "BEARING CS(BEARING CS.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "HOUSING BACK(HOUSING BACK.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "HOUSING FRONT(HOUSING FRONT.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW BACK(SCREW BACK.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW BACK(SCREW BACK.2)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW BACK(SCREW BACK.3)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW BACK(SCREW BACK.4)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW TOP(SCREW TOP.1)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW TOP(SCREW TOP.2)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW TOP(SCREW TOP.3)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "SCREW TOP(SCREW TOP.4)", 0);
|
||||
AddTarget(ppTargetsAllExceptWasher, idxTargetsAllExceptWasher, pModelFile, "CARBURETOR(CARBURETOR.1)", 0);
|
||||
|
||||
|
||||
// --- TARGETS - ALL THE MODEL
|
||||
ppTargetsAllModel = (A3DPDFTargetEntity**) malloc(INBTARGETSALLOC * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsAllModel=0;
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "HOUSING(HOUSING.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "CYLINDER LINER(CYLINDER LINER.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "HOUSING TOP(HOUSING TOP.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "PUSH ROD(PUSH ROD.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "BEARING PR DW(BEARING PR DW.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "BEARING PR UP(BEARING PR UP.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "AXE(AXE.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "PISTON(PISTON.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "CRANKSHAFT(CRANKSHAFT.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "BEARING CS(BEARING CS.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "HOUSING BACK(HOUSING BACK.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "HOUSING FRONT(HOUSING FRONT.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW BACK(SCREW BACK.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW BACK(SCREW BACK.2)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW BACK(SCREW BACK.3)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW BACK(SCREW BACK.4)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW TOP(SCREW TOP.1)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW TOP(SCREW TOP.2)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW TOP(SCREW TOP.3)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "SCREW TOP(SCREW TOP.4)", 0);
|
||||
AddTarget(ppTargetsAllModel, idxTargetsAllModel, pModelFile, "CARBURETOR(CARBURETOR.1)", 0);
|
||||
|
||||
|
||||
// --- TARGETS SET - just the washer
|
||||
ppTargetsWasher = (A3DPDFTargetEntity**) malloc(1 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsWasher=0;
|
||||
AddTarget(ppTargetsWasher, idxTargetsWasher, pModelFile, "BEARING PR DW(BEARING PR DW.1)", 0);
|
||||
|
||||
|
||||
// --- TARGETS SET - screw1
|
||||
ppTargetsScrew1 = (A3DPDFTargetEntity**) malloc(1 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsScrew1=0;
|
||||
AddTarget(ppTargetsScrew1, idxTargetsScrew1, pModelFile, "SCREW BACK(SCREW BACK.1)", 0);
|
||||
|
||||
// --- TARGETS SET - screw2To4
|
||||
ppTargetsScrew2To4 = (A3DPDFTargetEntity**) malloc(3 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsScrew2To4=0;
|
||||
AddTarget(ppTargetsScrew2To4, idxTargetsScrew2To4, pModelFile, "SCREW BACK(SCREW BACK.2)", 0);
|
||||
AddTarget(ppTargetsScrew2To4, idxTargetsScrew2To4, pModelFile, "SCREW BACK(SCREW BACK.3)", 0);
|
||||
AddTarget(ppTargetsScrew2To4, idxTargetsScrew2To4, pModelFile, "SCREW BACK(SCREW BACK.4)", 0);
|
||||
|
||||
|
||||
// --- TARGETS SET - carbu
|
||||
ppTargetsCarbu = (A3DPDFTargetEntity**) malloc(1 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsCarbu=0;
|
||||
AddTarget(ppTargetsCarbu, idxTargetsCarbu, pModelFile, "CARBURETOR(CARBURETOR.1)", 0);
|
||||
|
||||
|
||||
// --- TARGETS SET - housing front
|
||||
ppTargetsHousingFront = (A3DPDFTargetEntity**) malloc(1 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsHousingFront=0;
|
||||
AddTarget(ppTargetsHousingFront, idxTargetsHousingFront, pModelFile, "HOUSING FRONT(HOUSING FRONT.1)", 0);
|
||||
|
||||
|
||||
// --- TARGETS SET - front casing
|
||||
ppTargetsCasingFront = (A3DPDFTargetEntity**) malloc(2 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsCasingFront=0;
|
||||
AddTarget(ppTargetsCasingFront, idxTargetsCasingFront, pModelFile, "CRANKSHAFT(CRANKSHAFT.1)", 0); // Casing front - crankshaft-
|
||||
AddTarget(ppTargetsCasingFront, idxTargetsCasingFront, pModelFile, "BEARING CS(BEARING CS.1)", 0); // Casing front - bearing cs
|
||||
|
||||
|
||||
// --- TARGETS SET - the 4 screws
|
||||
ppTargetsScrews = (A3DPDFTargetEntity**) malloc(4 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsScrews=0;
|
||||
AddTarget(ppTargetsScrews, idxTargetsScrews, pModelFile, "SCREW BACK(SCREW BACK.1)", 0);
|
||||
AddTarget(ppTargetsScrews, idxTargetsScrews, pModelFile, "SCREW BACK(SCREW BACK.2)", 0);
|
||||
AddTarget(ppTargetsScrews, idxTargetsScrews, pModelFile, "SCREW BACK(SCREW BACK.3)", 0);
|
||||
AddTarget(ppTargetsScrews, idxTargetsScrews, pModelFile, "SCREW BACK(SCREW BACK.4)", 0);
|
||||
|
||||
|
||||
// --- TARGETS SET - subasm mobile part
|
||||
ppTargetsMobilePart = (A3DPDFTargetEntity**) malloc(1 * A3DUns32(sizeof(A3DPDFTargetEntity*)));
|
||||
idxTargetsMobilePart=0;
|
||||
// we specify -1 as index to get the productoccurence entity
|
||||
AddTarget(ppTargetsMobilePart, idxTargetsMobilePart, pModelFile, "MOBILE PART(MOBILE PART.1)", -1);
|
||||
}
|
||||
@@ -0,0 +1,442 @@
|
||||
/***********************************************************************************************************************
|
||||
*
|
||||
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
||||
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
||||
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
||||
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
||||
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
||||
* scope and manner of such use.
|
||||
*
|
||||
***********************************************************************************************************************/
|
||||
/**
|
||||
\file AnimWorkinstruction.cpp
|
||||
|
||||
This file demonstrates how to programmatically create an animation.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#define INITIALIZE_A3D_API
|
||||
#include "AnimDef.hpp"
|
||||
#include "../CommonInit.h"
|
||||
#include <iostream>
|
||||
|
||||
// default sample arguments:
|
||||
// in visual c++: the current directory is set through properties to $OutDir, which is $(Platform)\$(Configuration)
|
||||
// in linux: the current directory is supposed to be the same as this cpp file
|
||||
#ifdef _MSC_VER
|
||||
# define IN_3DFILE SAMPLES_DATA_DIRECTORY"\\prc\\_micro engine.prc"
|
||||
# define IN_PDFFILE SAMPLES_DATA_DIRECTORY"\\pdf_templates\\AnimWorkinstructionTemplate.pdf"
|
||||
# define IN_POSTERIMAGE SAMPLES_DATA_DIRECTORY"\\images\\empty.jpg"
|
||||
# define OUT_FILE SAMPLES_PUBLISH_GALLERY_DIRECTORY"\\sample_AnimWorkinstruction.pdf"
|
||||
#else
|
||||
# define IN_3DFILE SAMPLES_DATA_DIRECTORY"/prc/_micro engine.prc"
|
||||
# define IN_PDFFILE SAMPLES_DATA_DIRECTORY"/pdf_templates/AnimWorkinstructionTemplate.pdf"
|
||||
# define IN_POSTERIMAGE SAMPLES_DATA_DIRECTORY"/images/empty.jpg"
|
||||
# define OUT_FILE SAMPLES_PUBLISH_GALLERY_DIRECTORY"/sample_AnimWorkinstruction.pdf"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
A3DStatus BuildPDFDocument()
|
||||
{
|
||||
A3DStatus iRet = A3D_SUCCESS;
|
||||
|
||||
// create empty document
|
||||
A3DPDFDocument* pDoc = NULL;
|
||||
CHECK_RET(A3DPDFDocumentCreateEmpty(&pDoc));
|
||||
|
||||
if (pDoc != NULL)
|
||||
{
|
||||
A3DPDFPage* pPage = NULL;
|
||||
|
||||
// the NULL suffix string keeps the same field names
|
||||
CHECK_RET(A3DPDFDocumentAppendPageFromPDFFileAndSuffixFields(pDoc, IN_PDFFILE, NULL, &pPage));
|
||||
|
||||
if (pPage != NULL)
|
||||
{
|
||||
// reading the input file; the file can be disposed of afterwards.
|
||||
A3DPDF3DStream* pStream;
|
||||
A3DAsmModelFile* pModelFile;
|
||||
A3DRWParamsLoadData sReadParam;
|
||||
A3D_INITIALIZE_DATA(A3DRWParamsLoadData, sReadParam);
|
||||
|
||||
sReadParam.m_sGeneral.m_bReadSolids = true;
|
||||
sReadParam.m_sGeneral.m_bReadSurfaces = true;
|
||||
sReadParam.m_sGeneral.m_bReadWireframes = true;
|
||||
sReadParam.m_sGeneral.m_bReadPmis = true;
|
||||
sReadParam.m_sGeneral.m_bReadAttributes = true;
|
||||
sReadParam.m_sGeneral.m_bReadHiddenObjects = false;
|
||||
sReadParam.m_sGeneral.m_bReadConstructionAndReferences = false;
|
||||
sReadParam.m_sGeneral.m_bReadActiveFilter = true;
|
||||
sReadParam.m_sGeneral.m_eReadingMode2D3D = kA3DRead_3D;
|
||||
sReadParam.m_sGeneral.m_eReadGeomTessMode = kA3DReadGeomAndTess;
|
||||
sReadParam.m_sGeneral.m_eDefaultUnit = kA3DUnitUnknown;
|
||||
sReadParam.m_sPmi.m_bAlwaysSubstituteFont = false;
|
||||
sReadParam.m_sPmi.m_pcSubstitutionFont = const_cast<A3DUTF8Char*>("Myriad CAD");
|
||||
sReadParam.m_sTessellation.m_eTessellationLevelOfDetail = kA3DTessLODMedium;
|
||||
sReadParam.m_sMultiEntries.m_bLoadDefault = true;
|
||||
sReadParam.m_sAssembly.m_bUseRootDirectory = true;
|
||||
CHECK_RET(A3DAsmModelFileLoadFromFile(IN_3DFILE, &sReadParam, &pModelFile));
|
||||
|
||||
if (pModelFile)
|
||||
{
|
||||
// creating the PRC stream from the model file that is going to be inserted into the PDF file
|
||||
A3DRWParamsExportPrcData sParamsExportData;
|
||||
A3D_INITIALIZE_DATA(A3DRWParamsExportPrcData, sParamsExportData);
|
||||
|
||||
CHECK_RET(A3DPDF3DStreamCreateFromModelFileAsPRC(pDoc, pModelFile, &sParamsExportData, &pStream, NULL));
|
||||
|
||||
// create all targets sets
|
||||
CreateAllTargetsSet(pModelFile);
|
||||
|
||||
// create each steps as a different animation
|
||||
const int INBANIMS = 10;
|
||||
A3DPDFAnimation **ppAnims = (A3DPDFAnimation**)malloc(INBANIMS * A3DUns32(sizeof(A3DPDFAnimation*)));
|
||||
int idxAnim = 0;
|
||||
double dStepInitTimeOffset = 0.0;
|
||||
double dStepTimeDuration;
|
||||
double dStartStep1, dStartStep2, dStartStep3, dStartStep4, dStartStep5, dStartStep6, dStartStep7, dStartStep8;
|
||||
dStartStep1 = 0.0;
|
||||
CHECK_RET(BuildAnimationStep1(&ppAnims[idxAnim++], dStepInitTimeOffset, dStepTimeDuration));
|
||||
dStepInitTimeOffset += dStepTimeDuration;
|
||||
dStartStep2 = dStepInitTimeOffset;
|
||||
CHECK_RET(BuildAnimationStep2(&ppAnims[idxAnim++], dStepInitTimeOffset, dStepTimeDuration));
|
||||
dStepInitTimeOffset += dStepTimeDuration;
|
||||
dStartStep3 = dStepInitTimeOffset;
|
||||
CHECK_RET(BuildAnimationStep3(&ppAnims[idxAnim++], dStepInitTimeOffset, dStepTimeDuration));
|
||||
dStepInitTimeOffset += dStepTimeDuration;
|
||||
dStartStep4 = dStepInitTimeOffset;
|
||||
CHECK_RET(BuildAnimationStep4(&ppAnims[idxAnim++], dStepInitTimeOffset, dStepTimeDuration));
|
||||
dStepInitTimeOffset += dStepTimeDuration;
|
||||
dStartStep5 = dStepInitTimeOffset;
|
||||
CHECK_RET(BuildAnimationStep5(&ppAnims[idxAnim++], dStepInitTimeOffset, dStepTimeDuration));
|
||||
dStepInitTimeOffset += dStepTimeDuration;
|
||||
dStartStep6 = dStepInitTimeOffset;
|
||||
CHECK_RET(BuildAnimationStep6(&ppAnims[idxAnim++], dStepInitTimeOffset, dStepTimeDuration));
|
||||
dStepInitTimeOffset += dStepTimeDuration;
|
||||
dStartStep7 = dStepInitTimeOffset;
|
||||
CHECK_RET(BuildAnimationStep7(&ppAnims[idxAnim++], dStepInitTimeOffset, dStepTimeDuration));
|
||||
dStepInitTimeOffset += dStepTimeDuration;
|
||||
dStartStep8 = dStepInitTimeOffset;
|
||||
|
||||
|
||||
// creating a poster image to be used as a poster for 3D.
|
||||
A3DPDFImage* pImage = NULL;
|
||||
A3DPDFImageCreateFromFile(pDoc, IN_POSTERIMAGE, kA3DPDFImageFormatUnknown, &pImage);
|
||||
|
||||
// creating the 3D artwork
|
||||
A3DPDF3DArtwork* p3DArtwork;
|
||||
A3DPDF3DArtworkData2 s3DArtworkData;
|
||||
A3D_INITIALIZE_DATA(A3DPDF3DArtworkData2, s3DArtworkData);
|
||||
|
||||
s3DArtworkData.m_pStream = pStream;
|
||||
s3DArtworkData.m_sDisplaySectionData.m_bAddSectionCaps = true;
|
||||
s3DArtworkData.m_eAnimationStyle = kA3DPDFAnimStyleBounce;
|
||||
s3DArtworkData.m_iNumberOfAnimations = idxAnim;
|
||||
s3DArtworkData.m_ppAnimations = ppAnims;
|
||||
CHECK_RET(A3DPDF3DArtworkCreate2(pDoc, &s3DArtworkData, &p3DArtwork));
|
||||
|
||||
// Default view activated at PDF opening
|
||||
A3DPDFView* pView;
|
||||
CHECK_RET(CreateView(pDoc, p3DArtwork,
|
||||
334.117035, 243.555069, 101.844193,
|
||||
45.135365, 43.723457, -33.948994,
|
||||
-0.311321, -0.183419, 0.932440,
|
||||
kA3DPDFOrthographicMode,
|
||||
1.0 / (2 * 106), 30,
|
||||
true, "Default", &pView));
|
||||
|
||||
|
||||
A3DPDF3DAnnotData sAnnotData;
|
||||
A3D_INITIALIZE_DATA(A3DPDF3DAnnotData, sAnnotData);
|
||||
|
||||
sAnnotData.m_bOpenModelTree = false;
|
||||
sAnnotData.m_bShowToolbar = true;
|
||||
sAnnotData.m_eLighting = kA3DPDFLightCADOptimized;
|
||||
sAnnotData.m_eRenderingStyle = kA3DPDFRenderingSolid;
|
||||
sAnnotData.m_sBackgroundColor.m_dRed = 0.25;
|
||||
sAnnotData.m_sBackgroundColor.m_dGreen = 0.25;
|
||||
sAnnotData.m_sBackgroundColor.m_dBlue = 0.25;
|
||||
sAnnotData.m_bTransparentBackground = false;
|
||||
sAnnotData.m_eActivateWhen = kA3DPDFActivPageOpened;
|
||||
sAnnotData.m_eDesactivateWhen = kA3DPDFActivPageClosed;
|
||||
sAnnotData.m_iAppearanceBorderWidth = 0;
|
||||
sAnnotData.m_pPosterImage = pImage;
|
||||
sAnnotData.m_p3DArtwork = p3DArtwork;
|
||||
A3DPDF3DAnnot* p3DAnnot = NULL;
|
||||
|
||||
|
||||
CHECK_RET(A3DPDF3DAnnotCreate(pDoc, &sAnnotData, &p3DAnnot));
|
||||
|
||||
// populating the field with the 3D annotation
|
||||
CHECK_RET(A3DPDFPageFieldSet3DAnnot(pPage, "But3D", p3DAnnot));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldListAddItem(pPage, "ListInstructions", "Start", "Step1"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldListAddItem(pPage, "ListInstructions", "Remove holding screws", "Step2"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldListAddItem(pPage, "ListInstructions", "Remove pump mini-housing", "Step3"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldListAddItem(pPage, "ListInstructions", "Remove front casing", "Step4"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldListAddItem(pPage, "ListInstructions", "Remove pump jet", "Step5"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldListAddItem(pPage, "ListInstructions", "Replace washer", "Step6"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldListAddItem(pPage, "ListInstructions", "Re-assemble engine", "Step7"));
|
||||
|
||||
|
||||
// set an action to populate a text field with the selected item in the list
|
||||
A3DUTF8Char myjslist[2048];
|
||||
sprintf(myjslist, "thisfield = this.getField(\"ListInstructions\");\n"
|
||||
"if(thisfield)\n"
|
||||
"{\n"
|
||||
" idx = thisfield.currentValueIndices;\n"
|
||||
" //f=this.getField(\"Details\");\n"
|
||||
" //f.value=thisfield.getItemAt(idx, false);\n"
|
||||
" selectstep(idx+1);\n"
|
||||
"}");
|
||||
CHECK_RET(A3DPDFPageFieldSetActionJavascriptFromString(pPage, "ListInstructions", myjslist));
|
||||
|
||||
sprintf(myjslist, "var list = this.getField(\"ListInstructions\");\n"
|
||||
"if (stiSelectedStep>1)\n"
|
||||
"{\n"
|
||||
" list.currentValueIndices = (stiSelectedStep-1)-1;\n"
|
||||
" decselectedstep();\n"
|
||||
"}");
|
||||
CHECK_RET(A3DPDFPageFieldSetActionJavascriptFromString(pPage, "PlayPrevious", myjslist));
|
||||
|
||||
sprintf(myjslist, "var list = this.getField(\"ListInstructions\");\n"
|
||||
"if (stiSelectedStep<7)\n"
|
||||
"{\n"
|
||||
" list.currentValueIndices = (stiSelectedStep+1)-1;\n"
|
||||
" incselectedstep();\n"
|
||||
"}");
|
||||
CHECK_RET(A3DPDFPageFieldSetActionJavascriptFromString(pPage, "PlayNext", myjslist));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldSetActionJavascriptFromString(pPage, "PlayStep", "runanimcurrentstep();"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldSetActionJavascriptFromString(pPage, "PlayAll", "runanimallsteps();"));
|
||||
|
||||
CHECK_RET(A3DPDFPageFieldSetActionJavascriptFromString(pPage, "Restart", "restartanim();"));
|
||||
|
||||
// store javascript functions on the document. these functions can be used by javascript stored on the fields.
|
||||
A3DUTF8Char myjsondoc[5 * 1024];
|
||||
sprintf(myjsondoc, "var stbuttonPlayer = 0;\n"
|
||||
"var stbuttonPlayerValInit = \"\";\n"
|
||||
"var stiSelectedStep = 0;\n"
|
||||
"var stdSelectedStepStart = 0;\n"
|
||||
"var stdSelectedStepEnd = 0;\n"
|
||||
"\n"
|
||||
"function incselectedstep()\n"
|
||||
"{\n"
|
||||
" if (stiSelectedStep<7)\n"
|
||||
" selectstep(stiSelectedStep+1);\n"
|
||||
"}\n"
|
||||
"function decselectedstep()\n"
|
||||
"{\n"
|
||||
" if (stiSelectedStep>1)\n"
|
||||
" selectstep(stiSelectedStep-1);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"function selectstep(istep)\n"
|
||||
"{\n"
|
||||
" // activate the 3D annotation\n"
|
||||
" // in getAnnots3D, page index starts from 0\n"
|
||||
" var a3d = this.getAnnots3D(0)[0];\n"
|
||||
" a3d.activated=true;\n"
|
||||
" c3d = a3d.context3D;\n"
|
||||
" detailsfield = this.getField(\"Details\");\n"
|
||||
" dStartStep1=%lf;\n"
|
||||
" dStartStep2=%lf;\n"
|
||||
" dStartStep3=%lf;\n"
|
||||
" dStartStep4=%lf;\n"
|
||||
" dStartStep5=%lf;\n"
|
||||
" dStartStep6=%lf;\n"
|
||||
" dStartStep7=%lf;\n"
|
||||
" dStartStep8=%lf;\n"
|
||||
" \n"
|
||||
" stiSelectedStep = istep;\n"
|
||||
" \n"
|
||||
" if (istep==1)\n"
|
||||
" {\n"
|
||||
" detailsfield.value=\"Follow these simple steps to replace the rubber washer on the micro engine 2*2001.\";\n"
|
||||
" stdSelectedStepStart = dStartStep1;\n"
|
||||
" stdSelectedStepEnd = dStartStep2;\n"
|
||||
" }\n"
|
||||
" else if (istep==2)\n"
|
||||
" {\n"
|
||||
" detailsfield.value=\"To get access to the washer we must first remove the locking screws on the back of the engine.\";\n"
|
||||
" stdSelectedStepStart = dStartStep2;\n"
|
||||
" stdSelectedStepEnd = dStartStep3;\n"
|
||||
" }\n"
|
||||
" else if (istep==3)\n"
|
||||
" {\n"
|
||||
" detailsfield.value=\"We need to remove the mini-housing before we can remove the font facing.\";\n"
|
||||
" stdSelectedStepStart = dStartStep3;\n"
|
||||
" stdSelectedStepEnd = dStartStep4;\n"
|
||||
" }\n"
|
||||
" else if (istep==4)\n"
|
||||
" {\n"
|
||||
" detailsfield.value=\"Removing the front casing will give us access to the washer.\";\n"
|
||||
" stdSelectedStepStart = dStartStep4;\n"
|
||||
" stdSelectedStepEnd = dStartStep5;\n"
|
||||
" }\n"
|
||||
" else if (istep==5)\n"
|
||||
" {\n"
|
||||
" detailsfield.value=\"To get access to the washer we also need to remove the pump jet.\";\n"
|
||||
" stdSelectedStepStart = dStartStep5;\n"
|
||||
" stdSelectedStepEnd = dStartStep6;\n"
|
||||
" }\n"
|
||||
" else if (istep==6)\n"
|
||||
" {\n"
|
||||
" detailsfield.value=\"We can now replace the washer. You may need to first add lubricant in case the washer is impacted.\";\n"
|
||||
" stdSelectedStepStart = dStartStep6;\n"
|
||||
" stdSelectedStepEnd = dStartStep7;\n"
|
||||
" }\n"
|
||||
" else if (istep==7)\n"
|
||||
" {\n"
|
||||
" detailsfield.value=\"Now re-assemble everything in the reverse order to which you took them off.\";\n"
|
||||
" stdSelectedStepStart = dStartStep7;\n"
|
||||
" stdSelectedStepEnd = dStartStep8;\n"
|
||||
" }\n"
|
||||
" butStep = this.getField(\"PlayStep\");\n"
|
||||
" butStep.buttonSetCaption(\"Play Step\");\n"
|
||||
" butStep.fillColor = color.white;\n"
|
||||
" runanim(\"PlayStep\", \"Play Step\", stdSelectedStepStart, stdSelectedStepEnd);\n"
|
||||
"}"
|
||||
"\n"
|
||||
"function funcCallbackStart()\n"
|
||||
"{\n"
|
||||
" if (stbuttonPlayer)\n"
|
||||
" {\n"
|
||||
" stbuttonPlayer.buttonSetCaption(\"Pause\");\n"
|
||||
" stbuttonPlayer.fillColor = color.gray;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"function funcCallbackStop()\n"
|
||||
"{\n"
|
||||
" if (stbuttonPlayer)\n"
|
||||
" {\n"
|
||||
" stbuttonPlayer.buttonSetCaption(stbuttonPlayerValInit);\n"
|
||||
" stbuttonPlayer.fillColor = color.white;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"//sButPlayerValInit= \"Play Step\" or \"Play All\"\n"
|
||||
"function runanim(sButPlayerName, sButPlayerValInit, dSelectedStepStart, dSelectedStepEnd)\n"
|
||||
"{\n"
|
||||
" pageIndex = this.pageNum;\n"
|
||||
" annotIndex = 0;\n"
|
||||
" annot = getAnnots3D(pageIndex)[annotIndex];\n"
|
||||
" if (annot != undefined) \n"
|
||||
" {\n"
|
||||
" context = annot.context3D;\n"
|
||||
" butStep = this.getField(\"PlayStep\");\n"
|
||||
" butAll = this.getField(\"PlayAll\");\n"
|
||||
" butCurrent = this.getField(sButPlayerName);\n"
|
||||
"\n"
|
||||
" if ( butCurrent.buttonGetCaption() == sButPlayerValInit ) \n"
|
||||
" {\n"
|
||||
" butStep.buttonSetCaption(\"Play Step\");\n"
|
||||
" butStep.fillColor = color.white;\n"
|
||||
" butAll.buttonSetCaption(\"Play All\");\n"
|
||||
" butAll.fillColor = color.white;\n"
|
||||
" butCurrent.buttonSetCaption(\"Pause\");\n"
|
||||
" butCurrent.fillColor = color.gray;\n"
|
||||
" stbuttonPlayer = butCurrent;\n"
|
||||
" stbuttonPlayerValInit = sButPlayerValInit;\n"
|
||||
" context.playSequence(dSelectedStepStart, dSelectedStepEnd, funcCallbackStart,funcCallbackStop);\n"
|
||||
" //context.playAnims(dSelectedStepStart, dSelectedStepStart, funcCallbackStart,funcCallbackStop);\n"
|
||||
" }\n"
|
||||
" else if ( butCurrent.buttonGetCaption() == \"Pause\" ) \n"
|
||||
" {\n"
|
||||
" butCurrent.buttonSetCaption(\"Continue\");\n"
|
||||
" context.runtime.pause();\n"
|
||||
" }\n"
|
||||
" else if ( butCurrent.buttonGetCaption() == \"Continue\" ) \n"
|
||||
" {\n"
|
||||
" butCurrent.buttonSetCaption(\"Pause\");\n"
|
||||
" context.runtime.play();\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"function runanimallsteps()\n"
|
||||
"{\n"
|
||||
" runanim(\"PlayAll\", \"Play All\", 0.0, -1);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"function runanimcurrentstep()\n"
|
||||
"{\n"
|
||||
" runanim(\"PlayStep\", \"Play Step\", stdSelectedStepStart, stdSelectedStepEnd);\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"function restartanim()\n"
|
||||
"{\n"
|
||||
" pageIndex = this.pageNum;\n"
|
||||
" annotIndex = 0;\n"
|
||||
" annot = getAnnots3D(pageIndex)[annotIndex];\n"
|
||||
" if (annot != undefined) \n"
|
||||
" {\n"
|
||||
" context = annot.context3D;\n"
|
||||
" butStep = this.getField(\"PlayStep\");\n"
|
||||
" butAll = this.getField(\"PlayAll\");\n"
|
||||
" butStep.buttonSetCaption(\"Play Step\");\n"
|
||||
" butStep.fillColor = color.white;\n"
|
||||
" butAll.buttonSetCaption(\"Play All\");\n"
|
||||
" butAll.fillColor = color.white;\n"
|
||||
" context.restartSequence();\n"
|
||||
" //context.restartAnims();\n"
|
||||
" }\n"
|
||||
"}",
|
||||
dStartStep1, dStartStep2, dStartStep3, dStartStep4, dStartStep5, dStartStep6, dStartStep7, dStartStep8);
|
||||
CHECK_RET(A3DPDFDocumentAddJavascriptFromString(pDoc, "MyFns", myjsondoc));
|
||||
|
||||
|
||||
|
||||
// cleaning up -- WARNING: DO NOT CALL THIS BEFORE A3DPDF3DArtworkCreate!
|
||||
CHECK_RET(A3DAsmModelFileDelete(pModelFile));
|
||||
|
||||
// saving the document
|
||||
CHECK_RET(A3DPDFDocumentSaveEx(pDoc, kA3DPDFSaveFull | kA3DPDFSaveOptimized, OUT_FILE));
|
||||
|
||||
CHECK_RET(A3DPDFDocumentClose(pDoc));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return iRet;
|
||||
}
|
||||
|
||||
|
||||
//######################################################################################################################
|
||||
// Main function
|
||||
#ifdef _MSC_VER
|
||||
int wmain(A3DInt32, A3DUniChar**)
|
||||
#else
|
||||
int main(int, A3DUTF8Char**)
|
||||
#endif
|
||||
{
|
||||
#ifndef _MSC_VER
|
||||
setenv("LC_NUMERIC", "en_US.UTF-8", 1); // Locally force locale
|
||||
#endif
|
||||
|
||||
// init A3DLIB library - automatically handled init/terminate
|
||||
A3DSDKHOOPSPublishLoader sHoopsPublishLoader(_T(HOOPS_BINARY_DIRECTORY));
|
||||
CHECK_RET(sHoopsPublishLoader.m_eSDKStatus);
|
||||
CHECK_RET(A3DDllSetCallbacksMemory(CheckMalloc, CheckFree));
|
||||
|
||||
// init HOOPS Publish related PDF library - automatically handled init/terminate
|
||||
// do it only only once during the life of the application
|
||||
CHECK_RET(sHoopsPublishLoader.InitPDFLib());
|
||||
|
||||
// launch PDF treatment
|
||||
A3DStatus iRet = BuildPDFDocument();
|
||||
if (iRet != A3D_SUCCESS)
|
||||
return iRet;
|
||||
|
||||
// Check memory allocations
|
||||
return (int)ListLeaks();
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{87A4D020-D1B4-11E2-8B8B-0800200C9A66}</ProjectGuid>
|
||||
<RootNamespace>AnimWorkinstruction</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(SolutionDir)\HOOPSExchangePublishSample.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>legacy_stdio_float_rounding.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AnimDef.cpp" />
|
||||
<ClCompile Include="AnimDefStep1.cpp" />
|
||||
<ClCompile Include="AnimDefStep2.cpp" />
|
||||
<ClCompile Include="AnimDefStep3.cpp" />
|
||||
<ClCompile Include="AnimDefStep4.cpp" />
|
||||
<ClCompile Include="AnimDefStep5.cpp" />
|
||||
<ClCompile Include="AnimDefStep6.cpp" />
|
||||
<ClCompile Include="AnimDefStep7.cpp" />
|
||||
<ClCompile Include="AnimDefStepInits.cpp" />
|
||||
<ClCompile Include="AnimDefTargets.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimWorkinstruction.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="AnimDef.hpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AnimDef.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStep1.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStep2.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStep3.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStep4.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStep5.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStep6.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStep7.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefStepInits.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimDefTargets.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AnimWorkinstruction.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="AnimDef.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user