Ejemplo n.º 1
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.);
}
Ejemplo n.º 2
0
TetraTrace::TetraTrace(int argc, char *argv[])
{
    Covise::set_module_description("perform particle-trace on tetrahedra-grids");

    Covise::add_port(INPUT_PORT, "gridIn", "UnstructuredGrid", "tetrahedra-grid");
    Covise::add_port(INPUT_PORT, "velIn", "Vec3", "velocity input");
    Covise::add_port(INPUT_PORT, "volIn", "Float", "volumes of tetrahedras");
    Covise::add_port(INPUT_PORT, "neighborIn", "Float", "neighbors of tetrahedras");

    Covise::add_port(OUTPUT_PORT, "traceOut", "Points|Polygons|Lines|TriangleStrips", "computed trace");
    Covise::add_port(OUTPUT_PORT, "dataOut", "Float|Vec3", "data to be mapped on the trace");

    Covise::add_port(PARIN, "startpoint1", "FloatVector", "...");
    Covise::set_port_default("startpoint1", "1.0 1.0 1.0");

    Covise::add_port(PARIN, "startpoint2", "FloatVector", "...");
    Covise::set_port_default("startpoint2", "1.0 2.0 1.0");

    Covise::add_port(PARIN, "normal", "FloatVector", "...");
    Covise::set_port_default("normal", "0.0 0.0 1.0");

    Covise::add_port(PARIN, "direction", "FloatVector", "...");
    Covise::set_port_default("direction", "1.0 0.0 0.0");

    Covise::add_port(PARIN, "numStart", "IntScalar", "number of traces to start");
    Covise::set_port_default("numStart", "10");

    Covise::add_port(PARIN, "startStep", "IntScalar", "initial timestep (transient only)");
    Covise::set_port_default("startStep", "1");

    Covise::add_port(PARIN, "whatOut", "Choice", "what data should we compute");
    Covise::set_port_default("whatOut", "1 number velocity magnitude");

    Covise::add_port(PARIN, "startStyle", "Choice", "how to compute starting-points");
    Covise::set_port_default("startStyle", "1 line plane sphere box");

    Covise::add_port(PARIN, "traceStyle", "Choice", "how to output the trace");
    Covise::set_port_default("traceStyle", "1 points lines easymesh mesh fader");

    Covise::add_port(PARIN, "numSteps", "IntScalar", "number of steps to compute");
    Covise::set_port_default("numSteps", "100");

    Covise::add_port(PARIN, "stepDuration", "FloatScalar", "duration of each step");
    Covise::set_port_default("stepDuration", "0.01");

    Covise::add_port(PARIN, "numNodes", "IntScalar", "number of nodes/processors to use");
    Covise::set_port_default("numNodes", "1");

    Covise::add_port(PARIN, "multiProcMode", "Choice", "which multi-processing mode to use");
    Covise::set_port_default("multiProcMode", "1 none SMP MMP");

    Covise::add_port(PARIN, "searchMode", "Choice", "which searching-algorithm to use for startcells");
    Covise::set_port_default("searchMode", "1 quick save");

    Covise::init(argc, argv);

    const char *in_names[] = { "gridIn", "velIn", "volIn", "neighborIn", NULL };
    const char *out_names[] = { "traceOut", "dataOut", NULL };

    setPortNames(in_names, out_names);
    setComputeTimesteps(0);

    setCallbacks();

    return;
};