mirror of
https://github.com/leozide/leocad.git
synced 2026-10-26 22:10:32 +00:00
Generate SDF glyphs for viewport overlays with configurable text and halo colors. Render view-sphere labels directly on the sphere surface from a compact vertical atlas, fitting translated labels to the printable area. Preserve the bitmap paths when shader objects are unavailable.
56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "lc_math.h"
|
|
#include "lc_context.h"
|
|
#include <bitset>
|
|
|
|
enum class lcViewSphereLocation
|
|
{
|
|
TopLeft,
|
|
TopRight,
|
|
BottomLeft,
|
|
BottomRight
|
|
};
|
|
|
|
class lcViewSphere
|
|
{
|
|
public:
|
|
lcViewSphere(lcView* View);
|
|
|
|
void Draw();
|
|
bool OnMouseMove();
|
|
bool OnLeftButtonUp();
|
|
bool OnLeftButtonDown();
|
|
bool IsDragging() const;
|
|
|
|
static void CreateResources(lcContext* Context);
|
|
static void DestroyResources(lcContext* Context);
|
|
|
|
protected:
|
|
void UpdateSettings();
|
|
lcMatrix44 GetViewMatrix() const;
|
|
lcMatrix44 GetProjectionMatrix() const;
|
|
std::bitset<6> GetIntersectionFlags(lcVector3& Intersection) const;
|
|
|
|
lcView* const mView = nullptr;
|
|
|
|
int mSize = 1;
|
|
bool mEnabled = false;
|
|
lcViewSphereLocation mLocation = lcViewSphereLocation::TopRight;
|
|
|
|
int mMouseDownX = 0;
|
|
int mMouseDownY = 0;
|
|
bool mMouseDown = false;
|
|
|
|
lcVector3 mIntersection;
|
|
std::bitset<6> mIntersectionFlags;
|
|
|
|
static lcTexture* mTexture;
|
|
static lcVertexBuffer mVertexBuffer;
|
|
static lcIndexBuffer mIndexBuffer;
|
|
static int mSphereIndexCount;
|
|
static const float mRadius;
|
|
static const float mHighlightRadius;
|
|
static const int mSubdivisions;
|
|
};
|