Skip to content

Instantly share code, notes, and snippets.

View malleor's full-sized avatar

Janusz Lenar malleor

View GitHub Profile
//
// in ExecuteManager::Execute:
//
IAlgorithm& v_alg = ...
ParamsIn v_in = ...
Context v_ctx = ...
// static data init
v_alg.Startup(v_ctx, v_in);
@malleor
malleor / A.py
Last active December 11, 2015 03:28
dla Kuby
from frames import script
@script
def A(a=3, b=5):
''' A returns bollox. '''
print 'Hello, framework.'
try:
args = {'a': 5}
@malleor
malleor / load_clouds.py
Last active December 11, 2015 03:19
Script execution concept Opt. 2: Denoted functions
from glob import glob
from os import cwd
from os.path import join, split, splitext
from frames import execute, script
@script(author='John Doe', version='0.6', multithreaded=False) # Declare the algorithm's info.
def load_clouds(cloud_extension='copsxml'): # Name and input params are given a a function with kwargs.
''' Loads all clouds of given format from the CWD. ''' # Documentation in a docstring.
cloud_ids = []
@malleor
malleor / load_clouds.py
Last active December 11, 2015 03:18
Script execution concept Opt. 1: Batch files
from glob import glob
from os import cwd
from os.path import join, split, splitext
from frames import execute
MANIFEST = { # Declare the algorithm info.
'doc': 'Loads all clouds of given format from the CWD.',
'author': 'John Doe',
'version': '0.6',
'multithreaded': False
@malleor
malleor / Remove doxygen comments
Created November 21, 2012 13:49
Interface class definition to implementation class definition in VS
\n*:b*///.@$ -> None
@malleor
malleor / gist:4116567
Created November 20, 2012 07:26
Header guard to pragma once in VS
\#ifndef {[A-Z_]@_H}:b*\n\#define \1:b*\n{(.*\n)*}\#endif(.*\1)*\n -> #pragma once\n\2
@malleor
malleor / points_in_radius_voxels_concept.cpp
Created October 25, 2012 20:24
Get points from spherical neighborhood given a voxel-sorted cloud of points
IProject& proj = ...;
float R = ...;
Eigen::Vector3d ref_point = ...;
IHierarchy& h = proj.GetDefHierarchy();
IHierarchy& all_clouds_h = Query(".cloud", h).Flatten().Result(); // gets flat structure of all clouds
auto all_clouds = all_clouds_h.GetRoot().GetElements();
IData& storage = proj.GetData();
// iterate through clouds
@malleor
malleor / Factory.cpp
Created May 29, 2012 15:10
Generic factoring
class IFactory
{
public:
virtual ~IFactory() {}
/// Creates data object of the specified type
template <class DataType>
DataType* CreateData()
{
return NULL;