NDDEM
Classes | Macros | Functions | Variables
Texturing server

Classes

class  Timestep
 Individual timestep data. More...
 
class  Texturing< d >
 Handles all the computation for the textures. More...
 

Macros

#define DeltaX   0.1
 Step in location for the visualisation. More...
 
#define FilePerLine   100
 Line size for single file tiled output. More...
 

Functions

int write_colormap_vtk (int d, vector< vector< float >> &colors)
 Writer for VTK colormaps. More...
 
int write_NrrdIO (string path, int d, vector< vector< float >> &colors)
 Writer for NRRD colormaps. More...
 
int write_img (char path[], int w, int h, uint8_t *px)
 Write for png textures. More...
 
int csvread_A (const char path[], v2d &result, int d)
 Reader for CSV orientation informations. More...
 
int csvread_XR (const char path[], v2d &result, v1d &R, int d)
 Reader for CSV location informations. More...
 
void filepathname (char *path, int n, int time, cv1d View)
 Filename generator. More...
 
void phi2color (vector< uint8_t >::iterator px, cv1d &phi, int d, vector< vector< float >> &colors)
 Convert from hyperspherical coordinates to actual pixel color, using the provided vector of colors. More...
 
map< string, string > parse_url (string &url)
 
template<int d>
void runthread_MasterRender (Texturing< d > *T)
 Function to call Texturing::MasterRender() More...
 
int main (int argc, char *argv[])
 Starts the server and handles the dispatching of the various commands. Default port is 54321. More...
 
void dispvector (const v1d &a)
 Convenient function to print a vector on screen. More...
 
void dispvector (const v1f &a)
 Convenient function to print a vector on screen. More...
 
void dispvector (const vector< int > &a)
 Convenient function to print a vector on screen. More...
 
template<int d>
void runthread_timeloop (Texturing< d > *T, v1d View, uint tsint, int nrotate)
 Function to call Texturing::timeloop() More...
 
template<int d>
void runthread_spaceloop (Texturing< d > *T, v1d View, uint tsint, int nrotate, int dim)
 Function to call Texturing::spaceloop() More...
 
int Texturing< d >::initialise (map< string, string > args)
 Loads all the data for the requested simulation in memory. More...
 
int Texturing< d >::clean ()
 Clean the data to get ready for another simulation rendering. More...
 
int Texturing< d >::SetNewViewPoint (map< string, string > args)
 Modify the current location and/or timestep en render. More...
 
bool Texturing< d >::isrendered ()
 Verify if the current location/timestep is already rendered. More...
 
int Texturing< d >::MasterRender ()
 Handle the rendering threads. More...
 
void Texturing< d >::spaceloop (v1d View, uint tsint, int nrotate, int dim)
 Run all the rendering in the current location, at all timesteps. More...
 
void Texturing< d >::timeloop (v1d View, uint tsint, int nrotate)
 Run all the rendering for the curent timestep, for all other location in dimensions higher than 3D view (ie. 4th dim, 5dim etc), varying only 1 dimension at a time. More...
 
void Texturing< d >::hereandnow (v1d View, uint tsint, int nrotate)
 Render the current location at the current timestep. More...
 
void Texturing< d >::Render (vector< string > &filerendered, cv1d &View, int nrotate, int time, cv2d &X, cv1d &R, cv2d &A)
 Do the actual rendering of the textures. More...
 
int Texturing< d >::set_grid (int nb)
 Set the grid in latitude-longitude. More...
 
int Texturing< d >::viewpermute (v1d &View)
 Rotate the viewpoint so that the rendered view is using the first 3 dimensions. Effectively unused since the visualisation only handles the rendring of the first 3 dimensions currently. More...
 
void Texturing< d >::filepathname (char *path, int n, int time, cv1d &View)
 Generates the proper texture name. More...
 
void Texturing< d >::filepathname (char *path, int time, cv1d &View)
 Generates the proper texture name. More...
 
int Texturing< d >::write_colormap_vtk_base ()
 Output the colormap as a vtk volume. More...
 
int Texturing< d >::write_colormap_nrrd_base (map< string, string > args)
 Output the texture as an NRRD file. More...
 
int Texturing< d >::write_vtkmap (map< string, string > args)
 Outputs the texture as a vtk surface. More...
 

Variables

v1d lambdagrid
 
v1d thetagrid
 
string DirectorySave
 
uint d
 
int N
 
v2d Boundaries
 
std::thread MasterRenderThread
 
std::mutex LockRender
 
bool blenderrender =false
 
Texturing< 3 > Texturing3
 
Texturing< 4 > Texturing4
 
Texturing< 5 > Texturing5
 
Texturing< 6 > Texturing6
 
Texturing< 7 > Texturing7
 
Texturing< 8 > Texturing8
 
Texturing< 9 > Texturing9
 
Texturing< 10 > Texturing10
 
int curd = -1
 
bool blenderrender
 

Detailed Description

This module handles the Texturing of higher dimensional rotating hyperspheres. It is designed to produced 2D textures that can be wrapped around spheres for visualisations.

It acts as an http server receiving calls from the visualation side, and producing textures as individual png files per particle/location/timestep. Unknown commands are trying to provide the requested file.
Default port is 54321
Example: http://localhost:54321/load?path=XXXX&resolution=5
Example: http://localhost:54321/render?ts=XXX&x4=2.5&5=3.2

More commands are available, cf. the main() function.

Macro Definition Documentation

◆ DeltaX

#define DeltaX   0.1

Step in location for the visualisation.

Warning
ad-hoc
Todo:
should be runtime value.

◆ FilePerLine

#define FilePerLine   100

Line size for single file tiled output.

Deprecated:
not really used at the moment.

Function Documentation

◆ clean()

template<int d>
int Texturing< d >::clean

Clean the data to get ready for another simulation rendering.

◆ csvread_A()

int csvread_A ( const char  path[],
v2d result,
int  d 
)

Reader for CSV orientation informations.

◆ csvread_XR()

int csvread_XR ( const char  path[],
v2d result,
v1d R,
int  d 
)

Reader for CSV location informations.

◆ dispvector() [1/3]

void dispvector ( const v1d a)
inline

Convenient function to print a vector on screen.

◆ dispvector() [2/3]

void dispvector ( const v1f a)
inline

Convenient function to print a vector on screen.

◆ dispvector() [3/3]

void dispvector ( const vector< int > &  a)
inline

Convenient function to print a vector on screen.

◆ filepathname() [1/3]

template<int d>
void Texturing< d >::filepathname ( char *  path,
int  n,
int  time,
cv1d View 
)

Generates the proper texture name.

◆ filepathname() [2/3]

void filepathname ( char *  path,
int  n,
int  time,
cv1d  View 
)

Filename generator.

◆ filepathname() [3/3]

template<int d>
void Texturing< d >::filepathname ( char *  path,
int  time,
cv1d View 
)

Generates the proper texture name.

◆ hereandnow()

template<int d>
void Texturing< d >::hereandnow ( v1d  View,
uint  tsint,
int  nrotate 
)

Render the current location at the current timestep.

◆ initialise()

template<int d>
int Texturing< d >::initialise ( map< string, string >  args)

Loads all the data for the requested simulation in memory.

Warning
No check is made that they fit in memory, be careful for large datasets

◆ isrendered()

template<int d>
bool Texturing< d >::isrendered

Verify if the current location/timestep is already rendered.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Starts the server and handles the dispatching of the various commands. Default port is 54321.

URL Commands:

/load : load the data. Should always be called first.

/render : renders the current timestep and location, and may also cache some additional ts and locations

/forcerender : DEPRECATED

/vtkcolormap : export the colormap in vtk format

/nrrdcolormap : export the colormap in nrrd format

/vtkmap : export the textures as vtk surfaces through the colormap instead of plane textures.

◆ MasterRender()

template<int d>
int Texturing< d >::MasterRender

Handle the rendering threads.

◆ parse_url()

map< string, string > parse_url ( string &  url)
Deprecated:
Do not use

◆ phi2color()

void phi2color ( vector< uint8_t >::iterator  px,
cv1d phi,
int  d,
vector< vector< float >> &  colors 
)

Convert from hyperspherical coordinates to actual pixel color, using the provided vector of colors.

◆ Render()

template<int d>
void Texturing< d >::Render ( vector< string > &  filerendered,
cv1d View,
int  nrotate,
int  time,
cv2d X,
cv1d R,
cv2d A 
)

Do the actual rendering of the textures.

◆ runthread_MasterRender()

template<int d>
void runthread_MasterRender ( Texturing< d > *  T)

Function to call Texturing::MasterRender()

◆ runthread_spaceloop()

template<int d>
void runthread_spaceloop ( Texturing< d > *  T,
v1d  View,
uint  tsint,
int  nrotate,
int  dim 
)

Function to call Texturing::spaceloop()

◆ runthread_timeloop()

template<int d>
void runthread_timeloop ( Texturing< d > *  T,
v1d  View,
uint  tsint,
int  nrotate 
)

Function to call Texturing::timeloop()

◆ set_grid()

template<int d>
int Texturing< d >::set_grid ( int  nb)

Set the grid in latitude-longitude.

◆ SetNewViewPoint()

template<int d>
int Texturing< d >::SetNewViewPoint ( map< string, string >  args)

Modify the current location and/or timestep en render.

◆ spaceloop()

template<int d>
void Texturing< d >::spaceloop ( v1d  View,
uint  tsint,
int  nrotate,
int  dim 
)

Run all the rendering in the current location, at all timesteps.

◆ timeloop()

template<int d>
void Texturing< d >::timeloop ( v1d  View,
uint  tsint,
int  nrotate 
)

Run all the rendering for the curent timestep, for all other location in dimensions higher than 3D view (ie. 4th dim, 5dim etc), varying only 1 dimension at a time.

◆ viewpermute()

template<int d>
int Texturing< d >::viewpermute ( v1d View)

Rotate the viewpoint so that the rendered view is using the first 3 dimensions. Effectively unused since the visualisation only handles the rendring of the first 3 dimensions currently.

◆ write_colormap_nrrd_base()

template<int d>
int Texturing< d >::write_colormap_nrrd_base ( map< string, string >  args)

Output the texture as an NRRD file.

◆ write_colormap_vtk()

int write_colormap_vtk ( int  d,
vector< vector< float >> &  colors 
)

Writer for VTK colormaps.

◆ write_colormap_vtk_base()

template<int d>
int Texturing< d >::write_colormap_vtk_base

Output the colormap as a vtk volume.

Warning
(only working for 3D)

◆ write_img()

int write_img ( char  path[],
int  w,
int  h,
uint8_t px 
)

Write for png textures.

◆ write_NrrdIO()

int write_NrrdIO ( string  path,
int  d,
vector< vector< float >> &  colors 
)

Writer for NRRD colormaps.

◆ write_vtkmap()

template<int d>
int Texturing< d >::write_vtkmap ( map< string, string >  args)

Outputs the texture as a vtk surface.


Variable Documentation

◆ blenderrender [1/2]

bool blenderrender =false

◆ blenderrender [2/2]

bool blenderrender
extern

◆ Boundaries

v2d Boundaries
extern

◆ curd

int curd = -1

◆ d

uint d
extern

◆ DirectorySave

string DirectorySave
extern

◆ lambdagrid

v1d lambdagrid
extern

◆ LockRender

std::mutex LockRender

◆ MasterRenderThread

std::thread MasterRenderThread

◆ N

int N
extern

◆ Texturing10

Texturing<10> Texturing10

◆ Texturing3

Texturing<3> Texturing3

◆ Texturing4

Texturing<4> Texturing4

◆ Texturing5

Texturing<5> Texturing5

◆ Texturing6

Texturing<6> Texturing6

◆ Texturing7

Texturing<7> Texturing7

◆ Texturing8

Texturing<8> Texturing8

◆ Texturing9

Texturing<9> Texturing9

◆ thetagrid

v1d thetagrid