#include "ortoolgrabview3d_tool.h"
#define ORTOOLGRABVIEW3D__CLASS ORTOOLGRABVIEW3D__CLASSNAME
#define ORTOOLGRABVIEW3D__LABEL "GrabView3D"
#define ORTOOLGRABVIEW3D__DESC "OR - Grab 3D Viewer Tool"
ORTOOLGRABVIEW3D__LABEL,
ORTOOLGRABVIEW3D__DESC,
bool ORToolGrabView3D::FBCreate()
{
StartSize[0] = 617;
StartSize[1] = 401;
UICreate ();
UIConfigure ();
UIReset ();
OnShow.Add (
this, (
FBCallback) &ORToolGrabView3D::EventToolShow );
OnIdle.Add (
this, (
FBCallback) &ORToolGrabView3D::EventToolIdle );
OnResize.Add(
this, (
FBCallback) &ORToolGrabView3D::EventToolResize );
OnPaint.Add (
this, (
FBCallback) &ORToolGrabView3D::EventToolPaint );
OnInput.Add (
this, (
FBCallback) &ORToolGrabView3D::EventToolInput );
return true;
}
void ORToolGrabView3D::UICreate()
{
int lS = 4;
AddRegion( "LabelDirections", "LabelDirections",
AddRegion( "ButtonFilePopup", "ButtonFilePopup",
AddRegion( "View3D", "View3D",
SetControl ( "LabelDirections", mLabelDirections );
SetControl ( "ButtonFilePopup", mButtonFilePopup );
SetView ( "View3D", mView );
}
void ORToolGrabView3D::UIConfigure()
{
int lWidth = mView.Region.Position.X[1] - mView.Region.Position.X[0];
int lHeight = mView.Region.Position.Y[1] - mView.Region.Position.Y[0];
char lTmp[2048];
sprintf( lTmp, "This is a demonstration of the FBVideoGrabber capabilities. It renders from frame 0 to 150.\n"
"Double-click in the window to start. Note: some codec must have width aligned to 4. Render size is %dx%d",
lWidth, lHeight );
mLabelDirections.Caption = lTmp;
mFilePopup.Caption = "Where to save the rendering...";
mFilePopup.Filter = "*.*";
mFilePopup.Path = mView.GetFilePath();
mFilePopup.FileName = mView.GetFileName();
mButtonFilePopup.Caption = mView.GetFilePath() + FBString( "\\" ) + mView.GetFileName();
mButtonFilePopup.OnClick.Add(
this, (
FBCallback) &ORToolGrabView3D::EventButtonFilePopup );
}
void ORToolGrabView3D::UIReset()
{
}
void ORToolGrabView3D::FBDestroy()
{
OnShow.Remove (
this, (
FBCallback) &ORToolGrabView3D::EventToolShow );
OnIdle.Remove (
this, (
FBCallback) &ORToolGrabView3D::EventToolIdle );
OnPaint.Remove (
this, (
FBCallback) &ORToolGrabView3D::EventToolPaint );
OnInput.Remove (
this, (
FBCallback) &ORToolGrabView3D::EventToolInput );
OnResize.Remove (
this, (
FBCallback) &ORToolGrabView3D::EventToolResize );
}
void ORToolGrabView3D::EventButtonFilePopup(
HISender pSender,
HKEvent pEvent )
{
mFilePopup.Execute();
mButtonFilePopup.Caption = (const char*)mFilePopup.FullFilename;
mView.SetFilePath( mFilePopup.Path );
mView.SetFileName( mFilePopup.FileName );
}
{
RefreshView();
}
void ORToolGrabView3D::RefreshView()
{
mView.Refresh(true);
}
{
FBEventShow lEvent( pEvent );
if( lEvent.Shown )
{
}
}
{
}
{
int Width = mView.Region.Position.X[1] - mView.Region.Position.X[0];
int Height = mView.Region.Position.Y[1] - mView.Region.Position.Y[0];
char Tmp[2048];
sprintf(Tmp, "This is a demonstration of the FBVideoGrabber capabilities. It renders from frame 0 to 150.\nRender size is %dx%d. Double-click in the window to start.\nNote: some codecs have width and height requirements/limitations.", Width, Height);
mLabelDirections.Caption = Tmp;
}
{
}
bool ORToolGrabView3D::FbxStore ( FBFbxObject* pFbxObject,
kFbxObjectStore pStoreWhat )
{
pFbxObject->FieldWriteBegin( "ORToolGrabView3DSection" );
{
}
pFbxObject->FieldWriteEnd();
return true;
}
bool ORToolGrabView3D::FbxRetrieve( FBFbxObject* pFbxObject,
kFbxObjectStore pStoreWhat )
{
pFbxObject->FieldReadBegin( "ORToolGrabView3DSection" );
{
}
pFbxObject->FieldReadEnd();
return true;
}