// ProjectionType.h
//     VectorWorks core file
//
// Copyright 2002 Diehl Graphsoft, Inc.
// All Rights Reserved.
//
// This file contains the definition of the ProjectionType structure, which stores
// information about the viewpoint, type of projection, and current rendering mode.
// This was split off from MinicadCallbacks.h to reduce dependencies.
//
// Started by Andrew Bell on 3/7/2002.
//
// SourceSafe information for this revision:
//    $Revision: $
//    $Date: $
//    $Author: $

#ifndef _PROJECTIONTYPE_H_
#define _PROJECTIONTYPE_H_ 1
#pragma once

#include "SysName.h"


//////////////////////////////////////////////////////////////////////////////////////////
// ProjectionType

//--------------------------------------------------------------------
#pragma pack(push, 2) // BEGIN 2 BYTE STRUCTURE ALIGNMENT (.vwx file format)

struct ProjectionType {
	const TransformMatrix&  ScreenMatrix() const { return screenMatrix; }
	short RenderMode() const { return render; }
	short Projection() const { return projection; }

	void SetTransformMatrix(const TransformMatrix&  matrix)
		{ screenMatrix = matrix; }
	void SetRenderMode(short newMode) { render = newMode; }
	void SetProjection(short newProjection) { projection = newProjection; }

	ProjectionType& operator=(const ProjectionType& inProj)	{ memcpy(this, &inProj, sizeof(ProjectionType)); return *this; }

	TransformMatrix			screenMatrix;
	short					projection;
	short					render;
	WorldCoord				crsPersDistance;
	WorldCoord				clipDistance;
	WorldRect				projClipRect;
	
	void ByteSwap();
};
#pragma pack(pop)	// END 2 BYTE STUCTURE AIGNMENT <.vwx file format>


#endif // _PROJECTIONTYPE_H_
