LVectorBase::GetCamera

#include "ltwrappr.h"

virtual L_INT LVectorBase::GetCamera(pVectorCamera)

pVECTORCAMERA pVectorCamera;

/* pointer to a structure */

Gets the current camera values.

Parameter

Description

pVectorCamera

Pointer to a VECTORCAMERA structure to be updated with the current camera values.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function will get the current viewing camera.

The camera is used with the view port to determine how the drawing will be projected into the destination DC when using LVectorBase::Paint.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LVectorBase::SetCamera, LVectorBase::Paint

Topics:

Manipulating the Camera

 

Vector Images: Viewing a Vector Image

Example

/* LVectorBase::GetCamera() */
/* LVectorBase::SetCamera() */
L_INT LVectorBase__GetCameraExample(HWND hWnd)
{
   L_INT          nRet;
   VECTORCAMERA   camera;
   L_TCHAR        szTemp[300];
   LVectorBase    Vector;
   nRet = Vector.Load(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 16\\Images\\test.dxf"));
   if(nRet != SUCCESS)
      return nRet;
   nRet = Vector.GetCamera(&camera);
   if(nRet != SUCCESS)
      return nRet;
   wsprintf(szTemp,
            TEXT("New Camera\nTheta[%f]\nPhi[%f]\nLookAt[%f,%f,%f]\nDistance[%lf]\nPerspective[%s]"), 
            camera.Theta,
            camera.Phi,
            camera.LookAt.x,
            camera.LookAt.y,
            camera.LookAt.z,
            camera.Distance,
            camera.bPerspective? TEXT("TRUE"): TEXT("FALSE")
            );
   MessageBox(hWnd, szTemp, TEXT(""), MB_OK);
   camera.Theta +=20;
   nRet = Vector.SetCamera(&camera);
   if(nRet != SUCCESS)
      return nRet;
   wsprintf(szTemp, 
            TEXT("New Camera\nTheta[%f]\nPhi[%f]\nLookAt[%f,%f,%f]\nDistance[%lf]\nPerspective[%s]"), 
            camera.Theta,
            camera.Phi,
            camera.LookAt.x,
            camera.LookAt.y,
            camera.LookAt.z,
            camera.Distance,
            camera.bPerspective? TEXT("TRUE"): TEXT("FALSE")
            );
   MessageBox(hWnd, szTemp, TEXT(""), MB_OK);
   return SUCCESS;
}