LVectorBase::GetCamera

Summary

Gets the current camera values.

Syntax

#include "ltwrappr.h"

virtual L_INT LVectorBase::GetCamera(pVectorCamera)

Parameters

pVECTORCAMERA pVectorCamera

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

Returns

Value Meaning
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

See Also

Functions

Topics

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(MAKE_IMAGE_PATH(TEXT("random.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; 
} 
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.