SPH
Classes | Typedefs | Functions
Utils.h File Reference

Random utility functions for drawing stuff to DC. More...

#include "common/Globals.h"
#include "gui/renderers/IRenderer.h"
#include "objects/Object.h"
#include "objects/wrappers/Flags.h"
#include "run/VirtualSettings.h"
#include <wx/window.h>

Go to the source code of this file.

Classes

class  BusyCursor
 

Typedefs

using FileFormat = IVirtualEntry::FileFormat
 

Functions

Optional< PathdoSaveFileDialog (const std::string &title, Array< FileFormat > &&formats)
 
Optional< PathdoOpenFileDialog (const std::string &title, Array< FileFormat > &&formats)
 
void drawTextWithSubscripts (wxDC &dc, const std::wstring &text, const wxPoint point)
 
void drawTextWithSubscripts (wxDC &dc, const std::string &text, const wxPoint point)
 
std::wstring toPrintableString (const Float value, const Size precision=5, const Float decimalThreshold=1000._f)
 Converts the value to a printable string. More...
 
void printLabels (wxDC &dc, ArrayView< const IRenderOutput::Label > labels)
 

Detailed Description

Random utility functions for drawing stuff to DC.

Author
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file Utils.h.

Typedef Documentation

◆ FileFormat

Definition at line 21 of file Utils.h.

Function Documentation

◆ doOpenFileDialog()

Optional<Path> doOpenFileDialog ( const std::string &  title,
Array< FileFormat > &&  formats 
)

Definition at line 45 of file Utils.cpp.

◆ doSaveFileDialog()

Optional<Path> doSaveFileDialog ( const std::string &  title,
Array< FileFormat > &&  formats 
)

Definition at line 56 of file Utils.cpp.

◆ drawTextWithSubscripts() [1/2]

void drawTextWithSubscripts ( wxDC &  dc,
const std::string &  text,
const wxPoint  point 
)

Definition at line 117 of file Utils.cpp.

◆ drawTextWithSubscripts() [2/2]

void drawTextWithSubscripts ( wxDC &  dc,
const std::wstring &  text,
const wxPoint  point 
)

Draws a text into the DC using current font and color, replacing all _x with corresponding subscript character.

Definition at line 86 of file Utils.cpp.

◆ printLabels()

void printLabels ( wxDC &  dc,
ArrayView< const IRenderOutput::Label labels 
)

Definition at line 186 of file Utils.cpp.

◆ toPrintableString()

std::wstring toPrintableString ( const Float  value,
const Size  precision = 5,
const Float  decimalThreshold = 1000._f 
)

Converts the value to a printable string.

Definition at line 121 of file Utils.cpp.