All Projects → vittorioromeo → SSVUtils

vittorioromeo / SSVUtils

Licence: other
[HEADER-ONLY] C++14 multi-purpose utility library that only depends on the STL.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to SSVUtils

Safe stl
A safe version of STL
Stars: ✭ 17 (-71.67%)
Mutual labels:  stl
stl-part-viewer
A lit-element web component that uses Three.js to display an STL model file.
Stars: ✭ 19 (-68.33%)
Mutual labels:  stl
GoSlice
This is an experimental slicer for 3d printing written in Go also usable as modular slicing lib.
Stars: ✭ 69 (+15%)
Mutual labels:  stl
BackportCpp
Library of backported modern C++ types to work with C++11
Stars: ✭ 53 (-11.67%)
Mutual labels:  stl
LipSync
An open-source mouth operated sip and puff joystick that enables people with limited hand function emulate a mouse on their computer and/or smartphone.
Stars: ✭ 27 (-55%)
Mutual labels:  stl
learning-cpp
Contains c/c++, java, operating system, data structure and algorithm, database, network communication, and related books
Stars: ✭ 35 (-41.67%)
Mutual labels:  stl
USmallFlat
Ubpa small flat containers based on C++20
Stars: ✭ 20 (-66.67%)
Mutual labels:  stl
stl-gcode-viewer
STL/OBJ/GCode Viewer in Qt
Stars: ✭ 49 (-18.33%)
Mutual labels:  stl
MKS WIFI upgrade with BeePrint web interface
Firmware for MKS WiFi module from Makerbase with BeePrint Web Interface, tested with Flying Bear Ghost 5/Ghost 4/Reborn
Stars: ✭ 35 (-41.67%)
Mutual labels:  stl
COMPETITVE-PROGRAMMING
Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying to program according to provided specifications. This repo contains the Detailed Explanation and implementation of Various Coding problems on various platforms in C++
Stars: ✭ 60 (+0%)
Mutual labels:  stl
CVIP
C/C++/Golang/Linux...知识整理
Stars: ✭ 62 (+3.33%)
Mutual labels:  stl
android-3d-model-viewer
Android app to load 3D models in obj, stl, dae & gltf format using pure OpenGL ES 2.0. Published on Play Store https://play.google.com/store/apps/details?id=org.andresoviedo.dddmodel2
Stars: ✭ 150 (+150%)
Mutual labels:  stl
Print3r
Command line interface (CLI) for 3d printing
Stars: ✭ 41 (-31.67%)
Mutual labels:  stl
dicom2stl
Python script to extract a STL surface from a DICOM image series.
Stars: ✭ 151 (+151.67%)
Mutual labels:  stl
stl
Clean examples of STL algorithms
Stars: ✭ 22 (-63.33%)
Mutual labels:  stl
HxSTLParser
Basic STL loader for SceneKit
Stars: ✭ 23 (-61.67%)
Mutual labels:  stl
vasaro
Vasaro let you create 3d printable vases in a snap.
Stars: ✭ 30 (-50%)
Mutual labels:  stl
erkir
Երկիր (Erkir) - a C++ library for geodesic and trigonometric calculations
Stars: ✭ 26 (-56.67%)
Mutual labels:  stl
PolyDraw
✳️ PTSource PolyDraw is a free 3D polygonal modeller for Windows x86 and x64, for creating or modifying 3D objects using a mesh of 3D points and parametric NURBS Curves .Exports and imports to over 40 formats including WebVR and 3D Printing.
Stars: ✭ 17 (-71.67%)
Mutual labels:  stl
ToolpathGenerator
Automating Toolpath Planing and Generation for 3-Axis CNC
Stars: ✭ 26 (-56.67%)
Mutual labels:  stl

SSVUtils Build Status

C++14 multi-purpose utility library that only depends on the STL.

The code examples below are currently outdated.


CommandLine

--

Delegates

int result{0};
ssvu::Delegate<void(int)> onSomething;
onSomething += [&](int mValue){ result += mValue; };
onSomething += [&](int mValue){ result += mValue * 2; };
onSomething(2);
assert(result == 6);

Encoding

string source{"encode me!"};
auto encoded = ssvu::Encoding::encode<Encoding::Type::Base64>(source);
auto decoded = ssvu::Encoding::decode<Encoding::Type::Base64>(encoded);
assert(source == decoded);

FileSystem

string myPath{"/home/folder"};
ssvu::FileSystem::normalizePath(myPath);
assert(myPath == "/home/folder/");

if(!ssvu::FileSystem::exists(myPath)) ssvu::FileSystem::createFolder(myPath);

ssvu::FileSystem::removeFile(myPath + "garbage_file");

string homePath{ssvu::FileSystem::getParentPath(myPath)};
assert(homePath == "/home/");

for(const auto& filePath : ssvu::FileSystem::getScan<Mode::Recurse, Type::File>(myPath))
	// Iterate on all file paths (recursively)

for(const auto& subFolderPath : ssvu::FileSystem::getScan<Mode::Recurse, Type::Folder>(myPath))
	// Iterate on all sub folder paths (recursively)

// and more...

Global

// std::unique_ptr is verbose
using namespace ssvu;

Uptr<int> test{new int};
Uptr<int, SomeCustomDeleter>{new int};

Log

using namespace ssvu;

lo << lt("Testing log") << "Hello!" << endl;
// Prints to console: "[Testing log]	Hello!"

saveLogToFile("log.txt");
// Saves everything that was logged to "log.txt"

MemoryManager

--

PreAlloc

--

String

string test{"abcdef"};

assert(ssvu::beginsWith(test, "abc"));
assert(ssvu::endsWith(test, "def"));

string test2{"ABCDEF"};
assert(ssvu::toLower(test2) == test);

ssvu::replaceAll(test, "abc", "ABC");
assert(ssvu::beginsWith(test, "ABC"));

test += ssvu::toStr(100);
assert(test == "ABCdef100");

// and more...

TemplateSystem

// Example 1
using namespace ssvu::TemplateSystem;
Dictionary dict{{"key1", "value1"}, {"key2", "value2"}};
string toExpand{".{{key1}}.{{key2}}."};
assert(dict.getExpanded(toExpand) == ".value1.value2.");

// Example 2
using namespace ssvu::TemplateSystem;
Dictionary dict;
Dictionary subdict1{{"key", "value1"}};
Dictionary subdict2{{"key", "value2"}};
dict += {"section", subdict1};
dict += {"section", subdict2};
string toExpand{"{{#section}}.{{key}}.{{/section}}"};
assert(dict.getExpanded(toExpand) == ".value1..value2.");

Timeline

--

Utils

auto i = ssvu::getRnd(0, 5); // get random int [0, 5)
auto f = ssvu::getRndF(0.f, 5.f); // get random float [0.f, 5.f)

auto x = ssvu::getRnd(0, 100);
auto clamped = ssvu::getClamped(x, 40, 60); // gets x clamped between 40 and 60

auto rr = ssvu::toRadians(720.f);
auto dd = ssvu::toDegrees(rr);
assert(ssvu::wrapDegrees(dd) == 360.f);

std::vector<int> container{0, 5, 10, 15};
ssvu::eraseRemove(container, 10);
// container is now = {0, 5, 15}

ssvu::eraseRemoveIf(container, [&](const int& mValue){ return mValue > 0; });
// container is now = {0}

assert(ssvu::contains(container, 0));
assert(!ssvu::contains(container, 5));
assert(!ssvu::containsAny(container, {10, 15}));

// and more...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].