/// Constructor coReadMeteo::coReadMeteo(int argc, char *argv[]) : coModule(argc, argv, "Read files to create a list of points (stars) and scalar parameters.") , lineBuf(NULL) , lineBufSize(0) { // Create ports: poData = addOutputPort("Data", "StructuredGrid|Float", "Height Field or data"); poData->setInfo("Height field or data"); // Create parameters: pbrFile = addFileBrowserParam("FilePath", "First file of sequence or single file"); pbrFile->setValue("data/", "*"); pDimX = addInt32Param("DimX", "X Dimension"); pDimX->setValue(40); pDimY = addInt32Param("DimY", "Y Dimension"); pDimY->setValue(40); pDimZ = addInt32Param("DimZ", "Z Dimension"); pDimZ->setValue(16); pScale = addFloatParam("Scale", "Scale factor"); pScale->setValue(0.001f); pboDataMode = addBooleanParam("DataMode", "Read files as data (instead of height information)"); pboDataMode->setValue(true); pboWarnings = addBooleanParam("Warnings", "Display warnings when reading files"); pboWarnings->setValue(true); }
CorrectPyramids::CorrectPyramids() : coSimpleModule("Correct pyramids") { _p_in_grid = addInputPort("meshIn", "coDoUnstructuredGrid", "input mesh"); _p_out_grid = addOutputPort("meshOut", "coDoUnstructuredGrid", "output mesh"); _p_volume = addFloatParam("relative_volume", "relative volume"); _p_volume->setValue(0.05); }
frTFBlur(const frPluginDef* d) : frTexturePlugin(d) { addTwoFloatParam("Blur Radius", 3.0f, 3.0f, 1.0f, 128.0f, 0.01f, 3); addFloatParam("Intensity", 1.0f, 0.0f, 255.0f, 0.025f, 2); addSelectParam("Filter", "box|triangle|gaussian", 2); addSelectParam("Border Pixels", "black|clamp|wrap", 0); }
frTFRotoZoom(const frPluginDef* d) : frTexturePlugin(d) { addFloatParam("Angle", 0.0f, -10000.0f, 10000.0f, 1.0f, 2); addTwoFloatParam("Zoom", 1.0f, 1.0f, -255.0f, 255.0f, 0.01f, 6); addTwoFloatParam("Scroll", 0.0f, 0.0f, -100.0f, 100.0f, 0.01f, 6); addPointParam("Center", 0.5f, 0.5f, sFALSE); }
/*! \brief constructor * * create In/Output Ports and module parameters here */ LoadCadData::LoadCadData(int argc, char **argv) : coModule(argc, argv, "Read CAD data") { p_pointName = addOutputPort("model", "Points", "Model"); p_modelPath = addFileBrowserParam("modelPath", "modelPath"); p_scale = addFloatParam("scale", "global Scale factor used for OpenCover session"); p_resize = addFloatVectorParam("resize", "Resize factor"); p_rotangle = addFloatParam("rotangle", "angle for rotation"); p_tansvec = addFloatVectorParam("transvec", "Vector for translation"); p_rotvec = addFloatVectorParam("rotsvec", "Vector for rotation"); p_backface = addBooleanParam("backface", "Backface Culling"); p_orientation_iv = addBooleanParam("orientation_iv", "Orientation of iv models like in Inventor Renderer"); p_convert_xforms_iv = addBooleanParam("convert_xforms_iv", "create LoadCadData DCS nodes"); p_scale->setValue(-1.0); p_rotangle->setValue(0); p_resize->setValue(1, 1, 1); }
StageObjectOverlay::StageObjectOverlay() { addStringParam("source", ""); addFloatParam("xoffset", 0, -200, 200); addFloatParam("yoffset", 0, -200, 200); addFloatParam("zoffset", 0, 0, 250); addFloatParam("scale",1,0,50); addFloatParam("rot angle", 0, -180, 180); addFloatParam("xrot", 0, -180, 180); addFloatParam("yrot", 0, -180, 180); addFloatParam("zrot", 0, -180, 180); addBoolParam("wireframe", false); }
Gen3D::Gen3D() :coModule("Make a 3D grid out of a 2") { p_inPoly = addInputPort("2D_Grid","Polygons","2D grid polygons"); p_inVelo = addInputPort("velocity","Vec3","velocity"); p_inPoly->setRequired(1); p_inVelo->setRequired(0); p_outGrid = addOutputPort("outGrid","UnstructuredGrid","unstructured Grid"); // 0 is as many as velocities set p_outVelo = addOutputPort("outVelo","Vec3","velocity"); p_thick = addFloatParam("thick","thickness of 3D-grid"); p_thick->setValue(0.05); };
DataHeight::DataHeight(int argc, char *argv[]) : coModule(argc, argv, "display scalar data as height map") { // input ports p_polyIn = addInputPort("poly", "Polygons", "input polygons"); p_dataIn = addInputPort("data", "Float", "input data"); p_normalsIn = addInputPort("normals", "Vec3", "input data"); // output port p_polyOut = addOutputPort("polyIn", "Polygons", "polygons displaced due to data"); // parameters: p_scale = addFloatParam("scale", "data scale"); p_scale->setValue(1.); }
Lic::Lic() { // this info appears in the module setup window set_module_description("LIC testing device"); //parameters //resolution = addInt32Param("Resolution", "resolution"); pixImgWidth = addInt32Param("Width", "width of pixel image"); pixImgHeight = addInt32Param("Height", "height of pixel image"); pixelSize = addInt32Param("Pixel Size", "bytes per pixel"); //domainSize = addFloatParam("Domain Size", "size"); scaleQuad = addFloatParam("Scale Quad", "quad size"); //const int defaultDim = 2; //resolution->setValue(defaultDim); const int defaultWidth = 8; pixImgWidth->setValue(defaultWidth); const int defaultHeight = 8; pixImgHeight->setValue(defaultHeight); const int defaultPixelSize = 4; pixelSize->setValue(defaultPixelSize); //const float defaultSize = 1.0; //domainSize->setValue(defaultSize); const float defaultSQ = 1.1; scaleQuad->setValue(defaultSQ); // the input ports polygonInPort = addInputPort("polygonIn", "coDoPolygons", "Polygons"); //vectorInPort = addInputPort("vectorIn","coDoVec3",\ "Vector Data"); // the output ports polygonOutPort = addOutputPort("polygonOut", "coDoPolygons", "Polygons"); packageOutPort = addOutputPort("packageOut", "coDoPolygons", "2D Triangle Patch"); textureOutPort = addOutputPort("textureOut", "coDoTexture", "Lic Texture"); }
relabs::relabs(int argc, char *argv[]) : coSimpleModule(argc, argv, "relabs") { //ports p_grid = addInputPort ("grid","UnstructuredGrid|Polygons","computation grid"); p_velo_in = addInputPort ("velocity", "Vec3","input vector data"); p_velo_out = addOutputPort ("v_out", "Vec3","v transformed"); p_rotaxis = addChoiceParam("Rotation_axis", "ConnectionMethod"); s_rotaxis[0] = strdup("x"); s_rotaxis[1] = strdup("y"); s_rotaxis[2] = strdup("z"); p_rotaxis->setValue(3, s_rotaxis, RotZ); p_revolutions = addFloatParam("rpm", "revolutions per minute"); p_revolutions->setValue(250.0); p_direction = addChoiceParam("rel2abs_or_abs2rel", "Rel2Abs or Abs2Rel"); s_direction[0] = strdup("abs2rel"); s_direction[1] = strdup("rel2abs"); p_direction->setValue(2, s_direction, Rel2Abs); }
/// Constructor coReadSTP3::coReadSTP3(int argc, char *argv[]) : coModule(argc, argv, "Read STP3 volume files.") { // Create ports: poGrid = addOutputPort("grid", "UniformGrid", "Grid for volume data"); poGrid->setInfo("Grid for volume data"); poVolume = addOutputPort("data", "Float", "Scalar volume data"); poVolume->setInfo("Scalar volume data (range 0-1)"); // Create parameters: pbrVolumeFile = addFileBrowserParam("FilePath", "STP3 file"); pbrVolumeFile->setValue("data", "*.img"); pboUseVoi = addBooleanParam("UseVoi", "Map data outside of volume of interest to constant value"); pboUseVoi->setValue(false); pisVoiNo = addInt32Param("NoVoi", "Number of volume of interest to use"); pisVoiNo->setValue(1); pfsIgnoreValue = addFloatParam("IgnoreValue", "Value data not within the volume of interest is mapped to"); pfsIgnoreValue->setValue(0.0); for (int i = 0; i < NO_VOIS; i++) { char buf1[1024], buf2[1024]; sprintf(buf1, "Volume%dFromVoi", i + 1); sprintf(buf2, "Number of volume of interest to use for volume %d", i + 1); pisVolumeFromVoi[i] = addInt32Param(buf1, buf2); pisVolumeFromVoi[i]->setValue(i + 2); sprintf(buf1, "voi%d", i + 1); sprintf(buf2, "Volume of interest no. %d", i + 1); poVoi[i] = addOutputPort(buf1, "Float", buf2); } }
void rechenraum::CreateUserMenu(void) { // fprintf(stderr, "Entering CreateUserMenu()\n"); char *tmp; int i; char path[512]; p_makeGrid = addBooleanParam("make_grid", "make grid?"); p_makeGrid->setValue(0); p_lockmakeGrid = addBooleanParam("lock_make_grid_button", "lock make grid button?"); p_lockmakeGrid->setValue(0); p_createGeoRbFile = addBooleanParam("create_geo_or_rb_file", "create geo/rb file?"); p_createGeoRbFile->setValue(0); p_gridSpacing = addFloatParam("spacing", "elements per floor square"); p_gridSpacing->setValue(4.); p_model_size = addFloatVectorParam("model_size", "model size"); p_model_size->setValue(36.54, 22.54, 3.20); p_nobjects = addInt32Param("n_objects", "make grid?"); p_nobjects->setValue(MAX_CUBES); p_Q_total = addFloatParam("Q_inlet_m3_h", "total flow rate in m3/h"); p_Q_total->setValue(320000.); p_v_SX9 = addFloatParam("v_SX9", "flow velocity at SX9 inlet and outlet in m/s"); p_v_SX9->setValue(0.84); sprintf(path, "%s/racks.txt", coCoviseConfig::getEntry("value", "Module.Rechenraum.GeorbPath", "/data/rechenraum").c_str()); p_BCFile = addStringParam("BCFile", "BCFile"); p_BCFile->setValue(path); sprintf(path, "%s/geofile.geo", coCoviseConfig::getEntry("value", "Module.Rechenraum.GeorbPath", "/data/rechenraum").c_str()); p_geofile = addStringParam("GeofilePath", "geofile path"); p_geofile->setValue(path); sprintf(path, "%s/rbfile.geo", coCoviseConfig::getEntry("value", "Module.Rechenraum.GeorbPath", "/data/rechenraum").c_str()); p_rbfile = addStringParam("RbfilePath", "rbfile path"); p_rbfile->setValue(path); m_Geometry = paraSwitch("Geometry", "Select Rack"); geo_labels = (char **)calloc(MAX_CUBES, sizeof(char *)); for (i = 0; i < MAX_CUBES; i++) { // create description and name geo_labels[i] = IndexedParameterName(GEO_SEC, i); paraCase(geo_labels[i]); // Geometry section tmp = IndexedParameterName("pos_rack", i); p_cubes_pos[i] = addFloatVectorParam(tmp, tmp); p_cubes_pos[i]->setValue(0.0, 0.0, 0.0); tmp = IndexedParameterName("size_rack", i); p_cubes_size[i] = addFloatVectorParam(tmp, tmp); p_cubes_size[i]->setValue(0.0, 0.0, 0.0); free(tmp); paraEndCase(); // Geometry section } paraEndSwitch(); // "GeCross section", "Select GeCross section" m_FlowRate = paraSwitch("FlowRate", "Select Rack"); flow_labels = (char **)calloc(MAX_CUBES - 1, sizeof(char *)); // racks without escalator and cold house float flowrate_racks[MAX_CUBES - 4] = { 5., // 0 Infrastruktur 5., // 1 Phoenix 4., // 2 NAS 3., // 3 DDN 3., // 4 Strider 5., // 5 Blech 5., // 6 Sx8R 5., // 7 IBM_BW_Grid 5., // 8 Disk_Rack_1 (5 Stueck) 5., // 9 Disk_Rack_2 (5 Stueck) 5., // 10 Disk_Rack_3 (5 Stueck) 5., // 11 Disk_Rack_4 (5 Stueck) 5., // 12 Disk_Rack_5 (4 Stueck) 5., // 13 Netz1 5., // 14 Disk_Rack_6 (5 Stueck) 5., // 15 IOX 5., // 16 Netz2 5., // 17 FC_Netz 5., // 18 Asama 5., // 19 Disk_Rack_7 (4 Stueck) 5., // 20 SX9 5., // 21 Neu1 5. // 22 Neu2 }; for (i = 0; i < MAX_CUBES - 4; i++) { // create description and name flow_labels[i] = IndexedParameterName(FLOW_SEC, i); paraCase(flow_labels[i]); tmp = IndexedParameterName("flowrate_rack", i); p_flowrate[i] = addFloatParam(tmp, tmp); p_flowrate[i]->setValue(flowrate_racks[i]); paraEndCase(); // FlowRate section } paraEndSwitch(); // Flowrate section #ifndef USE_STARTFILE setGeoParamsStandardForRechenRaum(); #endif }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++++ // ++++ Constructor : This will set up module port structure /// ++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParamTest::ParamTest(int argc, char *argv[]) : coSimpleModule(argc, argv, "Param Program: Show all parameter types") { //autoInitParam(0); // Immediate-mode String parameter stringImm = addStringParam("stringImm", "Immediate string"); stringImm->setValue("This is an immediate String Parameter"); // Immediate-mode Boolean parameter, pre-set to FALSE boolImm = addBooleanParam("boolImm", "Immediate coBooleanParam"); boolImm->setValue(0); iScalImm = addInt32Param("iScalImm", "Immediate coIntScalarParam"); iScalImm->setValue(123); fScalImm = addFloatParam("fScalImm", "Immediate coFloatParam"); fScalImm->setValue(-12.56f); // integer sliders: immediate and non-immediate iSlidImm = addIntSliderParam("iSlidImm", "Immediate coIntSliderParam"); iSlidImm->setValue(1, 27, 16); // float sliders: immediate and non-immediate fSlidImm = addFloatSliderParam("fSlidImm", "Immediate coFloatSliderParam"); fSlidImm->setValue(-10.0, 30.0, 0.0); // float vector: use default size of 3 and set with 3D setValue function fVectImm = addFloatVectorParam("fVectImm", "Immediate coFloatVectorParam"); fVectImm->setValue(1.34f, 1.889f, -99.87f); // it makes no sense to put a file selector in the switch, since // it is not displayed in the control panel browseImm = addFileBrowserParam("myFile", "a file browser"); browseImm->setValue("/var/tmp/whatever.txt", "*.txt"); browseImm->show(); browse = addFileBrowserParam("my2File", "a file browser"); browse->setValue("/var/tmp/whatever2.txt", "*.txt"); browse->show(); // Now this is a choice : we have the choice between 6 values const char *choiceVal[] = { "left lower inlet", "left upper inlet", "left center inlet", "right center inlet", "right lower Inlet", "right upper Inlet" }; choImm = addChoiceParam("choImm", "Nun auch noch Choices"); choImm->setValue(6, choiceVal, 1); // add an input port for 'coDoUnstructuredGrid' objects inPortReq = addInputPort("inputReq", "StructuredGrid", "Required input port"); // add another input port for 'coDoUnstructuredGrid' objects inPortNoReq = addInputPort("inputNoReq", "UnstructuredGrid", "Not required input port"); // tell that this port does not have to be connected inPortNoReq->setRequired(0); // add an output port for this type outPort = addOutputPort("outPort", "coDoUnstructuredGrid", "Output Port"); // and that's all ... no init() or anything else ... that's done in the lib }
Sample::Sample(int argc, char *argv[]) : coModule(argc, argv, "Sample data on points, unstructured and uniform grids to a uniform grid") { const char *outsideChoice[] = { "MAX_FLT", "user_defined_fill_value" }; const char *sizeChoice[] = { "user defined", "8", "16", "32", "64", "128", "256", "512", "1024" }; const char *algorithmChoices[] = { "possible holes", "no holes and no expansion", "no holes and expansion", "accurate and slow" /*, "number weights" */ }; const char *bounding_boxChoices[] = { "automatic per timestep", "automatic global", "manual" }; const char *pointSamplingChoices[] = { "linear", "logarithmic", "normalized linear", "normalized logarithmic" }; // fill value for outside outsideChoiceParam = addChoiceParam("outside", "fill value for outside - MAXFLT or number"); outsideChoiceParam->setValue(2, outsideChoice, 0); fillValueParam = addFloatParam("fill_value", "Fill Value if not intersecting"); fillValueParam->setValue(0.0); // choose algorithm p_algorithm = addChoiceParam("algorithm", "choose algorithm"); p_algorithm->setValue(4, algorithmChoices, 2); // choose mapping for point sampling p_pointSampling = addChoiceParam("point_sampling", "choose mapping for point sampling"); p_pointSampling->setValue(4, pointSamplingChoices, 2); // select dimension in i direction iSizeChoiceParam = addChoiceParam("isize", "unigrid size in i direction"); iSizeChoiceParam->setValue(9, sizeChoice, 3); iSizeParam = addInt32Param("user_defined_isize", "user defined i_size"); iSizeParam->setValue(32); jSizeChoiceParam = addChoiceParam("jsize", "unigrid size in j direction"); jSizeChoiceParam->setValue(9, sizeChoice, 3); jSizeParam = addInt32Param("user_defined_jsize", "user defined j_size"); jSizeParam->setValue(32); kSizeChoiceParam = addChoiceParam("ksize", "unigrid size in k direction"); kSizeChoiceParam->setValue(9, sizeChoice, 3); kSizeParam = addInt32Param("user_defined_ksize", "user defined k_size"); kSizeParam->setValue(32); p_bounding_box = addChoiceParam("bounding_box", "bounding box calculation"); p_bounding_box->setValue(3, bounding_boxChoices, 0); // default to manual float boundsIni[3] = { -1.0, -1.0, -1.0 }; p_P1bound_manual = addFloatVectorParam("P1_bounds", "First point"); p_P1bound_manual->setValue(3, boundsIni); float boundsEnd[3] = { 1.0, 1.0, 1.0 }; p_P2bound_manual = addFloatVectorParam("P2_bounds", "Second point"); p_P2bound_manual->setValue(3, boundsEnd); // eps to cover numerical problems epsParam = addFloatParam("eps", "small value to cover numerical problems"); epsParam->setValue(0.0); // add an input port for 'coDoUnstructuredGrid' objects Grid_In_Port = addInputPort("GridIn", "UnstructuredGrid|UniformGrid|RectilinearGrid|StructuredGrid|Points", "Grid input"); Data_In_Port = addInputPort("DataIn", "Float|Vec3", "Data input"); Data_In_Port->setRequired(0); Reference_Grid_In_Port = addInputPort("ReferenceGridIn", "UniformGrid", "Reference Grid"); Reference_Grid_In_Port->setRequired(0); // add an output port for this type Grid_Out_Port = addOutputPort("GridOut", "UniformGrid", "Grid Output Port"); Data_Out_Port = addOutputPort("DataOut", "Float|Vec3", "Data Output Port"); }
frTFNormalMap(const frPluginDef* d) : frTexturePlugin(d) { addFloatParam("Bumpyness", 1.0f, 0.01f, 63.0f, 0.01f, 2); }