//
//	Copyright © 2005 Nemetschek North America 
//	All Rights Reserved.
//
// Created by Vladislav Stanev

#ifndef VECTORWORKS_FOUNDATION_CLASSES_LIBRARY__H
#define VECTORWORKS_FOUNDATION_CLASSES_LIBRARY__H

#pragma once

#ifdef _DEBUG
# define	VWFC_ASSERT(x)		ASSERTN( kVStanev, x )
# define	VWFC_VERIFY(x)		VERIFYN( kVStanev, x )
#else
# define	VWFC_ASSERT(x)		
# define	VWFC_VERIFY(x)		x
#endif


// exception managment
#ifdef _DEBUG
# ifdef _WINDOWS
#  define		THROW_VWFC_EXCEPTION(ex,err,desc)		throw ex(err, desc, __FILE__, __LINE__)
# else
#  define		THROW_VWFC_EXCEPTION(ex,err,desc)		throw ex(err, desc, "unknown", 0)
# endif
# define		VWFC_EXCEPTION_DEFINITION(exName)		exName(int err, const char* desc, const char* szFile, size_t line);
# define		VWFC_EXCEPTION_IMPLEMENTATION(exName)	exName::exName(int err, const char* desc, const char* szFile, size_t line) : VWException( err, desc, szFile, line )
#else
# define		THROW_VWFC_EXCEPTION(ex,err,desc)		throw ex(err, desc)
# define		VWFC_EXCEPTION_DEFINITION(exName)		exName(int err, const char* desc);
# define		VWFC_EXCEPTION_IMPLEMENTATION(exName)	exName::exName(int err, const char* desc) : VWException( err, desc )
#endif

namespace VWFC
{
	// --------------------------------------------------------------------------------
	// Expection base class
	class VWException
	{
	public:
#ifdef _DEBUG
				VWException(int err, const char* desc, const char* szFile, size_t line)	{ fszDescription = desc; fnErrorNum = err; fszFile = szFile; fLine = line; DMSG(( kEveryone, "%s (%d) : VWException : %d -> %s!\n", fszFile, fLine, fnErrorNum, fszDescription )); }
#else
				VWException(int err, const char* desc)									{ fszDescription = desc; fnErrorNum = err; }
#endif
		virtual	~VWException()							{}

		int				fnErrorNum;
		const char*		fszDescription;
#ifdef _DEBUG
		const char*		fszFile;
		size_t			fLine;
#endif
	};

	// --------------------------------------------------------------------------------
	enum EMarkerType {
		kMarkerFilledArrow			= 0,
		kMarkerEmptyArrow			= 1,
		kMarkerOpenArrow			= 2,
		kMarkerFilledBall			= 3,
		kMarkerEmptyBall			= 4,
		kMarkerSlash				= 5,
		kMarkerCross				= 6
	};

	enum EArrowType {
		kArrowNormal				= arArrow,
		kArrowTight					= arTightArrow,
		kArrowBall					= arBall,
		kArrowSlash					= arSlash,
		kArrowCross					= arCross
	};
}

// --------------------------------------------------------------------------------
// This file should be included in your precompiled header
// so you will gain access to everything in the VectorWorks Fondation Classes Library

#ifdef _WINDOWS
	typedef		signed __int8			SInt8;
	typedef		unsigned __int8			UInt8;
	typedef		signed __int16			SInt16;
	typedef		unsigned __int16		UInt16;
	typedef		signed __int32			SInt32;
	typedef		unsigned __int32		UInt32;
	typedef		signed __int64			SInt64;
	typedef		unsigned __int64		UInt64;
#else
// these should be defined if not windows
#endif


// Memroy manager
// The memory manager always goes in the library
#include "Memory/VWMManager.h"

// -------------------------------------------------------------------------------
// Include STL library
#include <vector>
#include <map>

// -------------------------------------------------------------------------------
// VCOM standard interfaces
#include "../Interfaces/VWInterfaces.h"

using namespace VectorWorks::Math;

// Tools
#include "Tools/RGBColor.h"
#include "Tools/VWString.h"
#include "Tools/VWStringConv.h"
#include "Tools/ByteSwapper.h"
#include "Tools/ValueRestore.h"
#include "Tools/UUID.h"
#include "Tools/VWTiming.h"
#include "Tools/DataSerializer.h"
#include "Tools/STRResLoader.h"
#include "Tools/AutoClassing.h"

// Math namespace
#include "Math/VWPoint2D.h"
#include "Math/VWPoint3D.h"
#include "Math/VWTransformMatrix.h"
#include "Math/VWLine2D.h"
#include "Math/VWCircle2D.h"
#include "Math/VWRectangle2D.h"
#include "Math/VWPolygon.h"
#include "Math/VWLine3D.h"
#include "Math/VWPolygon3D.h"
#include "Math/VWMathUtils.h"
#include "Math/VWArc.h"
#include "Math/VWCube.h"
#include "Math/VWPolygonOperation.h"
#include "Math/VWPolygon3DOperation.h"
#include "Math/VWCubicInterpolation.h"
#include "Math/VWPlane.h"
#include "Math/VWNURBSCurve.h"
#include "Math/VWBodyFace.h"
#include "Math/VWBodyEdge.h"
#include "Math/VWBody.h"

// VWObjects namespace
#include "VWObjects/VWExceptions.h"
#include "VWObjects/VWObjectIterator.h"
#include "VWObjects/VWPattern.h"
#include "VWObjects/VWClassAttributes.h"
#include "VWObjects/VWObjectAttributes.h"
#include "VWObjects/VWClass.h"
#include "VWObjects/VWObject.h"
#include "VWObjects/VWDocument.h"
#include "VWObjects/VWGroupObj.h"
#include "VWObjects/VWLayerObj.h"
#include "VWObjects/VWLine2DObj.h"
#include "VWObjects/VWLocus2DObj.h"
#include "VWObjects/VWLocus3DObj.h"
#include "VWObjects/VWArcObj.h"
#include "VWObjects/VWPolygon2DObj.h"
#include "VWObjects/VWPolygon3DObj.h"
#include "VWObjects/VWExtrudeObj.h"
#include "VWObjects/VWSymbolDefObj.h"
#include "VWObjects/VWSymbolObj.h"
#include "VWObjects/VWWallObj.h"
#include "VWObjects/VWRoofFaceObj.h"
#include "VWObjects/VWRoofObj.h"
#include "VWObjects/VWRecordFormatObj.h"
#include "VWObjects/VWRecordObj.h"
#include "VWObjects/VWParametricObj.h"
#include "VWObjects/VWTextBlockObj.h"
#include "VWObjects/VWSolidObj.h"
#include "VWObjects/VWNURBSCurveObj.h"
#include "VWObjects/VWBodyObj.h"

// more tools
#include "Tools/ParamProviders.h"
#include "Tools/TaggedData.h"
#include "Tools/VWTaggedObj.h"

#endif // VECTORWORKS_FOUNDATION_CLASSES_LIBRARY__H