//================================================================
// 3DPanel header file
//
// AUTHOR:  Gabor Nagy
// DATE:    2024-Aug-20 18:42:29
//
// Copyright (C) 1996-2026 By Gabor Nagy. All rights reserved.
//================================================================
#ifndef _E3DP_Prefs_h
#define _E3DP_Prefs_h



#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
extern "C" {
#endif

enum
{
	E3dpPLACE_LEFT = 0,
	E3dpPLACE_RIGHT,
	E3dpPLACE_TOP,
	E3dpPLACE_BOTTOM
};



typedef struct
{
	char*           SchematicsFontName;

// These can be NULL, indicating to use the default paths (relative to the path from which the application was launched)
//
	char*           LogFile;
	char*           ResourcePath;
	char*           PluginPath;
	char*           PluginPath3DIO;
	char*           PluginPathImageIO;
	char*           TexturePath;

// These are the equivalents, but filled out
//
	char*           WorkingLogFile;
	char*           WorkingResourcePath;


	unsigned short  GLValueType;
	E3dCoord3       DefaultCameraPosition, DefaultAimPointPosition;
	E3dCoordinate   DefMag, DefFieldOfView;
	double          DefZNear, DefZFar;
	E3dCoordinate   DollyStep1, DollyStep2, DollyStep3;    // Mouse motion/transformation proportions
	E3dCoordinate   BankStep, OrbitStepLongitude, OrbitStepLatitude,
	                DollyStep, TrackStep,
	                FrameToTime, FrameToTimeStep;

	E3dCoord3       ScalingStep;
	E3dCoord3       RotatingStep;
	E3dCoord3       TranslatingStep;
	E3dCoord3       DefGridSizeDisplay;
	E3dCoord3       DefSubGridSizeDisplay;
	EInt32_3        GridCount;

	uint16_t        EdgeSteps;
	EBool           UseEdgeSteps;

	float           DefEyeDistance;

	double          CurrentFrame, StartFrame, EndFrame;    // TimePanel settings
	float           FramesPerSecond;

	EcRGBAiColor    BackgroundRGBAiColor,
	                GridRGBAiColors[E3dMAX_GRID_DEPTH], AxisRGBAiColor,
	                ShadedModeGridRGBAiColors[E3dMAX_GRID_DEPTH], ShadedModeAxisRGBAiColor,
	                AxisXRGBAiColor, AxisYRGBAiColor, AxisZRGBAiColor, AxisWRGBAiColor,
	                WireRGBAiColor, HWireRGBAiColor, SelGeoWireRGBAiColor, SelSubGeoWireRGBAiColor, SelPolyGroupWireRGBAiColor,
	                TextureProjectorRGBAiColor,
	                VertexRGBAiColor, HVertexRGBAiColor, ActivePointRGBAiColor, SelectedPointRGBAiColor,
	                ActiveEdgeRGBAiColor, SelectedEdgeRGBAiColor,
	                Line1RGBAiColor, Line2RGBAiColor,
	                SelectedPolygonRGBAiColor, ShadedSelectedPolygonRGBAiColor,
	                NormalRGBAiColor,
	                TangentRGBAiColor,
	                BoneRGBAiColor,
	                LockedItemRGBAiColor,
	                LeftEyeRGBAiColor, RightEyeRGBAiColor;

// For StatusPanel messages
//
	EcRGBAiColor    VariableRGBAiColor;
	uint32_t        ButtonNameRGBAp8Color, VariableRGBAp8Color,
	                ErrorRGBAp8Color, WarningRGBAp8Color,
	                OperationRGBAp8Color,
	                NodeBracketRGBAp8Color,   NodeNameRGBAp8Color,
	                ObjectBracketRGBAp8Color, ObjectNameRGBAp8Color,
	                PolyGroupBracketRGBAp8Color, PolyGroupNameRGBAp8Color,
	                XRGBAp8Color, YRGBAp8Color, ZRGBAp8Color;

	int16_t         StatusPanelTextAntiAliasing;  // On some old systems (SGI), status panel redraws with anti-aliased text would slow down things a lot, e.g. when moving the camera.

	short           AntiAliasing;    // For OpenGL views
	int             PointSize, SelectedPointSize, PickPointSize, RectangleSelectThreshold;
	float           LineWidth, LineWidthSelected,  LineWidthSplines, LineWidthSelectedSplines;
	float           ManipulatorRotSize, ManipulatorSize;

	int             MenuBarPlacement, MenuBarCascadeButtonType;

	int             MaxUndoSteps;

	EBool           PolyPaintOnSelectionOnly;    // Only ray-intersect selected objects when selecting Polygons

// Camera
//
	EBool           CameraFlyToVMOrtho,                // Use FrameToTime on these ViewModes
	                CameraFlyToVMSchematics,
	                CameraFlyToVMAnimation,
	                MouseWheelZoomAndDolly, MouseWheelForwardZoomIn,
	                CameraZoomToPointer;

	EBool           ShowPolygonCenters,
	                ShowPolygonNormals,
	                ShowSelectedPoints,
	                ShowSelectedPolygons,
	                ShowWireframeOfHiddenObjects,
	                ShowTextureProjectors,
	                ShowGridsInShadedMode,
	                ShowLampsInWireMode,
	                ShowLampsInSolidMode;

	EBool           UseQuickExposeBuffer,
	                UseTransformBuffer,          // Use image buffer for transformations in wireframe (only re-render objects being transformed)
	                UseCameraSpeedupBuffer;      // Similar as above for the Camera
	EBool           SelectingEnabled, DeletingEnabled;

	int             WindowHeaderIconSize;
	EBool           HighlightActive3DWindow;

	EBool           MenuBarOn;
	int             VMenuIconSize;

	EBool           TransformPanelOn, HeadersOn, TimePanelOn, TimeExtPanelOn,
	                FullScreenModeOn;

// ToolBar
//
	EBool           ToolBarOn,
	                InfoFolderOpen,
	                DisplayFolderOpen,
	                CameraFolderOpen,
	                LightFolderOpen,
	                CreateFolderOpen,
	                CloneFolderOpen,
	                TransformFolderOpen,
	                HierarchyFolderOpen,
	                GeometryFolderOpen,
	                SplineFolderOpen,
	                MaterialFolderOpen,
	                SurfaceFolderOpen,
	                DeleteFolderOpen,
	                EffectFolderOpen,
	                RenderFolderOpen,
	                SelectFolderOpen,
	                HistoryFolderOpen,
	                AnimationFolderOpen;

	int32_t         ToolBarIconSize;
	int32_t         DropDownPanelIconSize;


	EBool           StatusPanelOn;

	EBool           StereoEnabled;

	uint8_t         OptimizeFor;  // EOptimizeMEMORY or EOptimizeSPEED

	EBool           SelectNewModels;

	EBool           Schematics_AutoFrame;  // Automatically do a "frame all" on schematics views when things are added, until the user moves the camera on a Schematics view.
	char            Schematics_Orientation, Schematics_LinkStyle;
	EBool           Schematics_ShowObjects, Schematics_ShowPolyGroups;

// Delete selection
//
	EBool           DeleteSelection_DeleteSelectedPoints,
	                DeleteSelection_DeleteSelectedEdges,
	                DeleteSelection_DeleteUnusedVertices;

	uint16_t        Duplicate_Flags;

// Animation
//
	E3dCoordinate   NewAnimKeyEaseInOut;

	EBool           RedrawOnRendererChange;  // On some systems, we get an expose event when the pull-down menu is released...
} E3dpPrefs;


// MenuBarCascadeButtonType
//
enum
{
	E3dpMBT_ICON = 0,
	E3dpMBT_TEXT,
	E3dpMBT_ICON_AND_TEXT
};



extern E3dpPrefs   E3dp_Prefs;
extern EBool       E3dp_DrawMeshVerticesIfPolyGroupIsSelected;

extern void        E3dp_UpdateGridColors(const EcRGBAiColor* PBackgroundColor);


#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
}	// Close scope of 'extern "C"' declaration
#endif

#endif	// _E3DP_Prefs_h
