Skip to content

shapeworks::ShapeWorksUtils

Public Functions

Name
time_point now()
get the current time
double elapsed(time_point start, time_point end, bool print_elapsed =true)
return elapsed time in seconds, optionally printing to console
unsigned get_rng_seed()
returns random seed
void set_rng_seed(const unsigned seed)
sets random seed
unsigned get_random_number()
generates random number
std::string check_minimum_os_version()
void initialize_path_handling()
bool is_directory(const std::string & pathname)
returns true if pathname is a directory
bool file_exists(const std::string & filename)
returns true if filename exists and can be read
bool path_exists(const std::string & pathname)
returns true if a file or a directory exists at pathname
void setup_console_logging(bool show_progress, bool xml_status)
Set up the console logging options.
void set_progress_callback(void * ptr)
Set up a progress callback.
void setup_threads()
Set up the number of threads from TBB_NUM_THREADS env variable.
Matrix33 convert_matrix(const vtkSmartPointer< vtkMatrix4x4 > & mat)
converts a vtkMatrix4x4 to a Matrix33 and corresponding translationVector
Vector3 get_offset(const vtkSmartPointer< vtkMatrix4x4 > & mat)

Public Functions Documentation

function now

static inline time_point now()

get the current time

function elapsed

static double elapsed(
    time_point start,
    time_point end,
    bool print_elapsed =true
)

return elapsed time in seconds, optionally printing to console

function get_rng_seed

static inline unsigned get_rng_seed()

returns random seed

function set_rng_seed

static void set_rng_seed(
    const unsigned seed
)

sets random seed

function get_random_number

static inline unsigned get_random_number()

generates random number

function check_minimum_os_version

static std::string check_minimum_os_version()

Returns an error message if this OS is older than ShapeWorks supports, or "" if it's fine. On macOS the floor is the deployment target the build was compiled for.

function initialize_path_handling

static void initialize_path_handling()

Configure process-wide filesystem path handling. Call this once at startup, before any path is constructed from a narrow string.

function is_directory

static bool is_directory(
    const std::string & pathname
)

returns true if pathname is a directory

function file_exists

static bool file_exists(
    const std::string & filename
)

returns true if filename exists and can be read

function path_exists

static bool path_exists(
    const std::string & pathname
)

returns true if a file or a directory exists at pathname

function setup_console_logging

static void setup_console_logging(
    bool show_progress,
    bool xml_status
)

Set up the console logging options.

function set_progress_callback

static void set_progress_callback(
    void * ptr
)

Set up a progress callback.

function setup_threads

static void setup_threads()

Set up the number of threads from TBB_NUM_THREADS env variable.

function convert_matrix

static Matrix33 convert_matrix(
    const vtkSmartPointer< vtkMatrix4x4 > & mat
)

converts a vtkMatrix4x4 to a Matrix33 and corresponding translationVector

function get_offset

static Vector3 get_offset(
    const vtkSmartPointer< vtkMatrix4x4 > & mat
)

Updated on 2026-11-03 at 20:56:15 +0000