ReadHyperMesh::ReadHyperMesh(int argc, char **argv) : coSimpleModule(argc, argv, "Read Altair HyperMesh files") { // module parameters fileName = addFileBrowserParam("MeshFileName", "dummy"); fileName->setValue("./", "*.hm*"); resultsFileName = addFileBrowserParam("ReslutFileName", "dummy"); resultsFileName->setValue("./", "*.hm*;*.fma"); subdivideParam = addBooleanParam("subdivide", "Subdivide tet10 and hex20 elements"); subdivideParam->setValue(true); p_numt = addInt32Param("numt", "Nuber of Timesteps to read"); p_numt->setValue(1000); p_skip = addInt32Param("skip", "Nuber of Timesteps to skip"); p_skip->setValue(0); p_Selection = addStringParam("Selection", "Parts to load"); p_Selection->setValue("0-9999999"); // Output ports mesh = addOutputPort("mesh", "UnstructuredGrid", "Unstructured Grid"); mesh->setInfo("Unstructured Grid"); char buf[1000]; int i; for (i = 0; i < NUMRES; i++) { sprintf(buf, "data%d", i); dataPort[i] = addOutputPort(buf, "Float|Vec3", buf); dataPort[i]->setInfo(buf); } }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++++ // ++++ Constructor : This will set up module port structure // ++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Collect::Collect(int argc, char *argv[]) : coModule(argc, argv, "Combine grid, normals, colors, textures and vertex " "attributes in one data object for rendering") { // Parameters // Ports p_grid = addInputPort("GridIn0", "StructuredGrid|UnstructuredGrid|" "RectilinearGrid|UniformGrid|Points|Spheres" "|Lines|Polygons|Quads|Triangles|TriangleStrips", "Grid"); p_color = addInputPort("DataIn0", "Byte|Float|Vec3|RGBA", "Colors or Scalar Data for Volume Visualization"); p_color->setRequired(0); p_norm = addInputPort("DataIn1", "Vec3", "Normals"); p_norm->setRequired(0); p_text = addInputPort("TextureIn0", "Texture", "Textures"); p_text->setRequired(0); p_vertex = addInputPort("VertexAttribIn0", "Vec3|Float", "Vertex Attribute 0"); p_vertex->setRequired(0); p_outPort = addOutputPort("GeometryOut0", "Geometry", "combined object"); #ifdef MATERIAL p_material = addMaterialParam("Material", "Material definition for Renderer"); #endif p_varName = addStringParam("varName", "name of variant"); p_varName->setValue(""); p_attribute = addStringParam("attribute", "attributes in the form name=value;name2=value2;..."); p_attribute->setValue(""); p_boundsMinParam = addFloatVectorParam("minBound", "minimum bound"); p_boundsMinParam->setValue(0., 0., 0.); p_boundsMaxParam = addFloatVectorParam("maxBound", "maximum bound"); p_boundsMaxParam->setValue(0., 0., 0.); }
ComputeTrace::ComputeTrace(int argc, char *argv[]) : coSimpleModule(argc, argv, "Creates traces from points timestep dependent") , m_firsttime(true) { //the timesteps shall NOT be handled automatically by the coSimpleModule class setComputeTimesteps(1); /*Fed in points*/ p_pointsIn = addInputPort("GridIn0", "Points|Spheres", "a set of points or spheres containing the particle/s to be traced over time"); p_dataIn = addInputPort("DataIn0", "Float|Byte|Int|Vec2|Vec3|RGBA|Mat3|Tensor", "data mapped associated with spheres"); p_dataIn->setRequired(false); p_IDIn = addInputPort("IDIn0", "Int", "ID of each atom"); p_IDIn->setRequired(false); /*Boolean that specifies if a particle should be traced or not*/ p_traceParticle = addBooleanParam("traceParticle", "set if particle should be traced"); p_traceParticle->setValue(1); /*Integer that specifies the particle to be traced in Module Parameter window*/ p_particle = addStringParam("selection", "ranges of selected set elements"); p_particle->setValue("1-1"); p_maxParticleNumber = addInt32Param("maxParticleNum", "maximum number of particles to trace"); p_maxParticleNumber->setValue(100); /*Integer that specifies the starting point*/ p_start = addIntSliderParam("start", "Timestep at which the tracing should be started"); p_start->setValue(0, 0, 0); /*Integer that specifies the ending point*/ p_stop = addIntSliderParam("stop", "Timestep at which the tracing should be stopped"); p_stop->setValue(0, 0, 0); /* Boolean that specifies if the bounding box leaving should be regarded */ p_regardInterrupt = addBooleanParam("LeavingBoundingBox", "set if leaving bounding box should be taken into account"); p_regardInterrupt->setValue(0); p_animate = addBooleanParam("animate", "disable for static trace"); p_animate->setValue(1); /* 3 values specifying the x, y and z dimension of the bounding box */ p_boundingBoxDimensions = addFloatVectorParam("BoundingBoxDimensions", "x, y, z dimensions of the bounding box"); p_boundingBoxDimensions->setValue(0, 0, 0); /*Output should be a line*/ p_traceOut = addOutputPort("GridOut0", "Lines", "Trace of a specified particle"); /*unique index per line mappable as color attribute*/ p_indexOut = addOutputPort("DataOut0", "Float", "unique index for every specified particle"); /*fade out value per timestep mappable as color attribute*/ p_fadingOut = addOutputPort("DataOut1", "Float", "fade out value for per vertex coloring of lines over time"); p_dataOut = addOutputPort("DataOut2", "Float|Byte|Int|Vec2|Vec3|RGBA|Mat3|Tensor", "data mapped to lines"); p_dataOut->setDependencyPort(p_dataIn); IDs = NULL; assert(sizeof(animValues) / sizeof(animValues[0]) == AnimNumValues); p_animateViewer = addChoiceParam("animateViewer", "Animate Viewer"); p_animateViewer->setValue(AnimNumValues, animValues, AnimOff); p_animLookAt = addFloatVectorParam("animLookAt", "Animated viewer looks at this point"); p_animLookAt->setValue(0., 0., 0.); }
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); }
ModifyAddPart::ModifyAddPart() { int i; // no. of attached vents to cabin numVents = 0; // no. of read directories for vent description // default nothing numVentDirs = 1; for (i = 0; i < MAX_NAMES; i++) ventdirs[i] = NULL; // init some defaults for (i = 0; i < MAX_VENTS; i++) { fileid[i] = 0; exist[i] = 0; } // declare the name of our module set_module_description("Add parts to the Cabin"); // paramter for vent directory structure p_ventDir = addStringParam("ventPath", "Path for vent descriptions"); p_ventDir->setValue("data/visit/icem/test"); ventFilePath = "data/visit/icem/test"; // get the directory structure for all vents in given path getVentDirs(); // create the COVISE parameter // user can set a subdirectory for vents createVentParam(); // what do you want to calculate p_action = addChoiceParam("Set Action", "select the action"); p_action->setValue(nAction, action, currAction); // tetin object describing the cabin inTetin = addInputPort("tetinObj", "DO_Tetin", "coTetin object"); inTetin->setRequired(1); // output objects for transfer directory and vent polygons solverText = addOutputPort("solverText", "coDoText", "Command for StarCD"); outPolygon = addOutputPort("polygon_set", "coDoPolygons", "Geometry output"); prostarData = addOutputPort("prostarData", "coDoText", "Part data for Prostar"); }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++++ // ++++ Constructor : This will set up module port structure // ++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Hello::Hello(int argc, char *argv[]) : coModule(argc, argv, "Hello, world! program") { #ifdef E1 stringParam = addStringParam("Output Text", "Text that should be sent to COVISE"); #endif #ifdef E2 boolParam = addBooleanParam("Show String", "Show the text parameter in the Control Panel"); #endif #if defined(E3) || defined(E5) geoOutPort = addOutputPort("geometries", "Lines|Polygons", "Output geometries"); #endif #ifdef E4 dataOutPort = addOutputPort("data", "Unstructured_S3D_Data", "Output data"); #endif }
void ReadCadmould::createParam() { // file browser parameter p_filename = addFileBrowserParam("filename", "file name of Fuellbild or .cfe file"); p_filename->setValue("data/nofile", "?????;*.cfe"); // p_filename->setValue("data/Kunden/faurecia/CADMOULD-Test/nofile","?????");// // 3 grid ports : stationary, transient, filling p_mesh = addOutputPort("stMesh", "UnstructuredGrid", "stationary mesh"); p_stepMesh = addOutputPort("trMesh", "UnstructuredGrid", "transient mesh"); p_thick = addOutputPort("thick", "Float", "thickness of elements"); // the output ports and choices // Loop for data fields: choices and ports char name[32]; const char *defaultChoice[] = { "---" }; for (int i = 0; i < NUM_PORTS; i++) { sprintf(name, "Choice_%d", i); p_choice[i] = addChoiceParam(name, "Select data for port"); p_choice[i]->setValue(1, defaultChoice, 0); sprintf(name, "Data_%d", i); p_data[i] = addOutputPort(name, "Float|IntArr", name); } p_no_time_steps = addInt32Param("fillTimeStep", "time steps for filling"); p_no_time_steps->setValue(25); const char *defaultFill[] = { "automatic" }; p_fillField = addChoiceParam("fillField", "Select field for filling"); p_fillField->setValue(1, defaultFill, 0); p_no_data_color = addStringParam("noDataColor", "RGBA color for non-filled elements"); p_no_data_color->setValue("0xd0d0d0ff"); // p_byteswap = addBooleanParam("byteSwapping","byte_swapping"); p_fillMesh = addOutputPort("fiMesh", "UnstructuredGrid", "mesh for filling"); p_fillData = addOutputPort("fiValuw", "Float", "data for filling"); }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++++ // ++++ Constructor : This will set up module port structure // ++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CoolEmAllToDatabase::CoolEmAllToDatabase(int argc, char *argv[]) : coModule(argc, argv, "CoolEmAllToDatabase, world! program") { // no parameters, no ports... p_grid = addInputPort("grid", "UnstructuredGrid", "Distributed Grid"); p_boco = addInputPort("boco", "USR_FenflossBoco", "Boundary Conditions"); p_temp = addInputPort("temp", "Float", "Temperature Values"); p_p = addInputPort("pressure", "Float", "Pressure Values"); p_velo = addInputPort("velocities", "Vec3", "Velocity Values"); p_gridOut = addOutputPort("gridout", "UnstructuredGrid", "the computational mesh"); p_databasePrefix = addStringParam("databasePrefix", "databasePrefix"); p_databasePrefix->setValue("none"); p_csvPath = addFileBrowserParam("csvPath", "path to csv file"); p_csvPath->setValue("/tmp/CoolEmAll.csv", "*.csv"); p_grid->setRequired(1); p_boco->setRequired(1); p_temp->setRequired(0); p_p->setRequired(0); p_velo->setRequired(0); }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // ++++ // ++++ Constructor : This will set up module port structure // ++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SelectIdx::SelectIdx() : coModule("SelectIdx") { // Parameters // create the parameter int i; char buffer[64]; for (i = 0; i < NUM_PORTS; i++) { sprintf(buffer, "In_%d", i); p_in[i] = addInputPort(buffer, "DO_Rectilinar_Grid|coDoUnstructuredGrid|coDoFloat|coDoVec3", "Input fields"); sprintf(buffer, "OUT_%d", i); p_out[i] = addOutputPort(buffer, "coDoUnstructuredGrid|coDoFloat|coDoVec3", "Output fields"); p_in[i]->setRequired(0); p_out[i]->setDependency(p_in[i]); } p_index = addInputPort("index", "coDoIntArr", "Selection index field"); // parameter p_selection = addStringParam("select", "Value selection"); sprintf(buffer, "%d-%d", -MAXINT, MAXINT); p_selection->setValue(buffer); }
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 }
KeypressSensor::KeypressSensor() { addStringParam("key", " "); }