/// Returns a map with all declared property names and 0.
std::map<std::string, size_t>
CompositeBraggScatterer::getPropertyCountMap() const {
  std::map<std::string, size_t> propertyUseCount;

  std::vector<Property *> compositeProperties = getProperties();
  for (auto &compositeProperty : compositeProperties) {
    propertyUseCount.emplace(compositeProperty->name(), 0);
  }
  return propertyUseCount;
}
	CoreSyncData MultiRenderTexture::syncToCore(FrameAlloc* allocator)
	{
		UINT32 size = sizeof(MultiRenderTextureProperties);
		UINT8* buffer = allocator->alloc(size);

		MultiRenderTextureProperties& props = const_cast<MultiRenderTextureProperties&>(getProperties());

		memcpy(buffer, (void*)&props, size);
		return CoreSyncData(buffer, size);
	}
Esempio n. 3
0
void
TR::ARM64SystemLinkage::createEpilogue(TR::Instruction *cursor)
   {
   TR::CodeGenerator *codeGen = cg();
   const TR::ARM64LinkageProperties& properties = getProperties();
   TR::Machine *machine = codeGen->machine();
   TR::Node *lastNode = cursor->getNode();
   TR::ResolvedMethodSymbol *bodySymbol = comp()->getJittedMethodSymbol();
   TR::RealRegister *sp = machine->getRealRegister(properties.getStackPointerRegister());

   // restore callee-saved registers
   uint32_t offset = bodySymbol->getLocalMappingCursor();
   for (int r = TR::RealRegister::x19; r <= TR::RealRegister::x28; r++)
      {
      TR::RealRegister *rr = machine->getRealRegister((TR::RealRegister::RegNum)r);
      if (rr->getHasBeenAssignedInMethod())
         {
         TR::MemoryReference *stackSlot = new (trHeapMemory()) TR::MemoryReference(sp, offset, codeGen);
         cursor = generateTrg1MemInstruction(cg(), TR::InstOpCode::ldrimmx, lastNode, rr, stackSlot, cursor);
         offset += 8;
         }
      }
   for (int r = TR::RealRegister::v8; r <= TR::RealRegister::v15; r++)
      {
      TR::RealRegister *rr = machine->getRealRegister((TR::RealRegister::RegNum)r);
      if (rr->getHasBeenAssignedInMethod())
         {
         TR::MemoryReference *stackSlot = new (trHeapMemory()) TR::MemoryReference(sp, offset, codeGen);
         cursor = generateTrg1MemInstruction(cg(), TR::InstOpCode::vldrimmd, lastNode, rr, stackSlot, cursor);
         offset += 8;
         }
      }

   // restore link register (x30)
   TR::RealRegister *lr = machine->getRealRegister(TR::RealRegister::lr);
   if (machine->getLinkRegisterKilled())
      {
      TR::MemoryReference *stackSlot = new (trHeapMemory()) TR::MemoryReference(sp, 0, codeGen);
      cursor = generateTrg1MemInstruction(cg(), TR::InstOpCode::ldrimmx, lastNode, lr, stackSlot, cursor);
      }

   // remove space for preserved registers
   uint32_t frameSize = codeGen->getFrameSizeInBytes();
   if (constantIsUnsignedImm12(frameSize))
      {
      cursor = generateTrg1Src1ImmInstruction(codeGen, TR::InstOpCode::addimmx, lastNode, sp, sp, frameSize, cursor);
      }
   else
      {
      TR_UNIMPLEMENTED();
      }

   // return
   cursor = generateRegBranchInstruction(codeGen, TR::InstOpCode::ret, lastNode, lr, cursor);
   }
Esempio n. 4
0
RTC::ReturnCode_t ArmControlCartesian::onInitialize()
{
  // set properties
  HrprtcBase::onInitialize();


  //
  // Registration: InPort/OutPort/Service
  //
  // Set service provider to Ports
  m_ArmControlCartesianServicePort.registerProvider("service0", "ArmControlCartesianService", m_service0);

  // Set CORBA Service Ports
  addPort(m_ArmControlCartesianServicePort);


  //
  // set using part
  //
  // get properties
  RTC::Properties& prop = getProperties();
  std::string assignedPartName = prop["part.assigned_part."+m_instanceName];
  m_assignedPartIndex = -1;
  for(int i = 0; i < m_partNum; i++) {
    if ( m_partNames[i] == assignedPartName )
      m_assignedPartIndex = i;
  }
  if ( m_assignedPartIndex < 0 ) {
    std::cerr << m_instanceName << " : No part assigned Error." << std::endl;
    return RTC::RTC_ERROR;
  }
  std::cout << m_instanceName << " : using " << assignedPartName << " (part id=" << m_assignedPartIndex << ")" << std::endl;


  //
  // initialize jointPath
  //
  hrp::Link * first = m_robot->joint (*(m_partMembers[m_assignedPartIndex].begin ()));
  hrp::Link * base = m_robot->joint (first->parent->jointId);
  hrp::Link * end = m_robot->joint (*(m_partMembers[m_assignedPartIndex].end () - 1));
  m_jointPath = m_robot->getJointPath (base, end);
  m_jointPath->setBestEffortIKMode(true);
  std::cout << m_instanceName << " : " << assignedPartName << " member list =";
  for(int i = 0; i < m_jointPath->numJoints(); i++)
    std::cout << "  " << m_jointPath->joint(i)->name;
  std::cout << std::endl;

  //
  // initialize interpolator
  //
  m_pos_interpolator = new creek::Interpolator(3, m_dt, creek::QUINTIC);
  m_rot_interpolator = new creek::RotationalInterpolator(m_dt, creek::QUINTIC);

  return RTC::RTC_OK;
}
Esempio n. 5
0
// ------------------ volume ---------------------
SReal Cell::volume()
{
    StructuralComponent * facets = getFacets();
    if (!facets || getProperties()->getType()== StructureProperties::QUAD || getProperties()->getType()== StructureProperties::TRIANGLE)
        return 0.0;

    SReal vol=0.0;
    Cell * face;
    for (unsigned int i=0; i < facets->getNumberOfCells(); i++) {
        face = facets->getCell(i);
        SReal pos[3];
        ((Atom*)face->getStructure(0))->getPosition(pos);
        SReal * N = face->normal();
        vol += face->surface()* ( pos[0]*N[0] + pos[1]*N[1] + pos[2]*N[2] );
    }

    vol /= 3.0;
    return vol>0?vol:-vol;

}
void CabbageEnvelopeHandleComponent::mouseDown (const MouseEvent& e)
{

    x = getX();
    y = getY();

    setMouseCursor (MouseCursor::DraggingHandCursor);

    dragger.startDraggingComponent (this, e);

    if ((e.mods.isShiftDown() == true) && (e.mods.isRightButtonDown() == true))
        removeThisHandle();

    PopupMenu pop, subm;
    pop.setLookAndFeel(&this->getTopLevelComponent()->getLookAndFeel());
    subm.setLookAndFeel(&this->getTopLevelComponent()->getLookAndFeel());
    if(e.mods.isRightButtonDown() == true)
    {
        //pop.addItem(1, "Linear");
        //subm.addItem(2, "Convex");
        //subm.addItem(3, "Concave");
        //pop.addSubMenu("Expon", subm);
        pop.addItem(4, "Delete");

        int result;
#if !defined(AndroidBuild)		
		result = pop.show();
#endif
        if(result==1)
            getProperties().set(String("curveType"), LINEAR);
        else if(result==2)
            getProperties().set(String("curveType"), CONVEX);
        else if(result==3)
            getProperties().set(String("curveType"), CONCAVE);
        else if(result==4)
        {
            changeMessage = "removeHandle";
            sendChangeMessage();
        }
    }
}
Esempio n. 7
0
void CabbageEnvelopeHandleComponent::mouseDown (const MouseEvent& e)
{
	//setMouseCursor (MouseCursor::NoCursor);
	setMouseCursor (MouseCursor::DraggingHandCursor);
	dragger.startDraggingComponent (this, e);

	if ((e.mods.isShiftDown() == true) && (e.mods.isRightButtonDown() == true))
		removeThisHandle();

	PopupMenu pop;
	if(e.mods.isRightButtonDown() == true)
	{
		pop.addItem(1, "Linear");
		pop.addItem(2, "Expon");
		const int result = pop.show();
		if(result==1)
			getProperties().set(String("shape"), var("linear"));
		else 
			getProperties().set(String("shape"), var("expon"));
	}
}
Esempio n. 8
0
/**
 * Get all properties in a group.
 * @param group Name of a group.
 */
std::vector<Property *>
IPropertyManager::getPropertiesInGroup(const std::string &group) const {
  auto props = getProperties();
  for (auto prop = props.begin(); prop != props.end();) {
    if ((**prop).getGroup() == group) {
      ++prop;
    } else {
      prop = props.erase(prop);
    }
  }
  return props;
}
/// Returns a map with all declared property names and 0.
std::map<std::string, size_t>
CompositeBraggScatterer::getPropertyCountMap() const {
  std::map<std::string, size_t> propertyUseCount;

  std::vector<Property *> compositeProperties = getProperties();
  for (auto it = compositeProperties.begin(); it != compositeProperties.end();
       ++it) {
    propertyUseCount.insert(std::make_pair((*it)->name(), 0));
  }

  return propertyUseCount;
}
Esempio n. 10
0
void QUPowerDeviceInterface::propChanged()
{
    QVariantMap map = getProperties();
    QMapIterator<QString, QVariant> i(map);
    while (i.hasNext()) {
        i.next();
        if (pMap.value(i.key()) != i.value()) {
            pMap[i.key()] = i.value();
            Q_EMIT propertyChanged(i.key(), QVariant::fromValue(i.value()));
        }
    }
}
Esempio n. 11
0
static void openFileComponent(const ModelNode &modelNode)
{
    QmlDesignerPlugin::instance()->viewManager().nextFileIsCalledInternally();

    QHash<PropertyName, QVariant> propertyHash;

    getProperties(modelNode, propertyHash);
    Core::EditorManager::openEditor(modelNode.metaInfo().componentFileName(), Core::Id(), Core::EditorManager::DoNotMakeVisible);

    ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode();
    applyProperties(rootModelNode, propertyHash);
}
Esempio n. 12
0
size_t qpEncoder::getEncodedSize(const size_t n) const {

	const size_t propMaxLineLength =
		getProperties().getProperty <size_t>("maxlinelength", static_cast <size_t>(-1));

	const bool cutLines = (propMaxLineLength != static_cast <size_t>(-1));
	const size_t maxLineLength = std::min(propMaxLineLength, static_cast <size_t>(74));

	// Worst cast: 1 byte of input provide 3 bytes of output
	// Count CRLF (2 bytes) for each line.
	return n * 3 + (cutLines ? (n / maxLineLength) * 2 : 0);
}
Esempio n. 13
0
/** Clear out the contents of all logs of type TimeSeriesProperty.
 *  Single-value properties will be left unchanged.
 *
 *  The method has been fully implemented here instead of as a pass-through to
 *  PropertyManager to limit its visibility to Run clients.
 */
void LogManager::clearTimeSeriesLogs() {
  auto &props = getProperties();

  // Loop over the set of properties, identifying those that are time-series
  // properties
  // and then clearing them out.
  for (auto prop : props) {
    if (auto tsp = dynamic_cast<ITimeSeriesProperty *>(prop)) {
      tsp->clear();
    }
  }
}
Esempio n. 14
0
WidgetListBox::WidgetListBox(::Engines::GUI &gui, const Common::UString &tag,
                             const Common::UString &model) :
	ModelWidget(gui, tag, model), _contentX(0.0f), _contentY(0.0f), _contentZ(0.0f),
	_startItem(0), _selectedItem(0xFFFFFFFF), _up(0), _down(0), _scrollbar(0), _locked(false),
	_mode(kModeStatic), _hasScrollbar(false), _dblClicked(false) {

	_model->setClickable(true);

	getProperties();

	createScrollbar();
}
Esempio n. 15
0
/** Initialisation method
 */
void Fit1D::init()
{
  declareProperty(new WorkspaceProperty<MatrixWorkspace>("InputWorkspace","",Direction::Input), "Name of the input Workspace");

  auto mustBePositive = boost::make_shared<BoundedValidator<int> >();
  mustBePositive->setLower(0);
  declareProperty("WorkspaceIndex",0, mustBePositive,
    "The Workspace to fit, uses the workspace numbering of the spectra (default 0)");
  declareProperty("StartX", EMPTY_DBL(),
    "A value of x in, or on the low x boundary of, the first bin to include in\n"
    "the fit (default lowest value of x)" );
  declareProperty("EndX", EMPTY_DBL(),
    "A value in, or on the high x boundary of, the last bin the fitting range\n"
    "(default the highest value of x)" );

  size_t i0 = getProperties().size();

  // declare parameters specific to a given fitting function
  declareParameters();

  // load the name of these specific parameter into a vector for later use
  const std::vector< Property* > props = getProperties();
  for ( size_t i = i0; i < props.size(); i++ )
  {
    m_parameterNames.push_back(props[i]->name());
  }

  declareProperty("Fix","","A list of comma separated parameter names which should be fixed in the fit");
  declareProperty("MaxIterations", 500, mustBePositive,
    "Stop after this number of iterations if a good fit is not found" );
  declareProperty("OutputStatus","", Direction::Output);
  declareProperty("OutputChi2overDoF",0.0, Direction::Output);

  // Disable default gsl error handler (which is to call abort!)
  gsl_set_error_handler_off();

  declareAdditionalProperties();

  declareProperty("Output","","If not empty OutputParameters TableWorksace and OutputWorkspace will be created.");
}
Esempio n. 16
0
QUPowerDeviceInterface::QUPowerDeviceInterface(const QString &dbusPathName, QObject *parent)
    : QDBusAbstractInterface(QLatin1String(UPOWER_SERVICE)
    , dbusPathName
    , UPOWER_DEVICE_SERVICE
    , QDBusConnection::systemBus()
    , parent)
{
    path = dbusPathName;
    propertiesInterface = new QDBusInterface(UPOWER_SERVICE, path,
                                             "org.freedesktop.DBus.Properties",
                                             QDBusConnection::systemBus());
    pMap = getProperties();
}
Esempio n. 17
0
/**
 * Validate each input field against the related algorithm property.
 * @param inputFields :: The name of the input field and value of the field (key
 * => "StartDate", value => "00/00/0000").
 * @return The name of the input field(s) marker to update and related error to
 * throw.
 */
const std::map<std::string, std::string> CatalogHelper::validateProperties(
    const std::map<std::string, std::string> &inputFields) {
  auto catalogAlgorithm = createCatalogAlgorithm("CatalogSearch");

  // Holds the name of the marker to update if an error is found, and the
  // related error message to use.
  // E.g. key => "StartDate_err", value => "The start date for..."
  std::map<std::string, std::string> errors;

  // Validate all input elements in the map.
  for (auto iter = inputFields.begin(); iter != inputFields.end(); ++iter) {
    try {
      catalogAlgorithm->setProperty(iter->first, iter->second);
    } catch (std::invalid_argument &) {
      std::string documentation =
          propertyDocumentation(catalogAlgorithm->getProperties(), iter->first);

      // Add the input name + "_err" (to indicate the error marker in the GUI,
      // rather than the input field) as the key, and the related error as the
      // value.
      errors.emplace(iter->first + "_err", documentation);
    }
  }
  // catch invalid date formats
  std::string dateField = "StartDate";
  try {

    getTimevalue(catalogAlgorithm->getProperty(dateField));
    dateField = "EndDate";

    getTimevalue(catalogAlgorithm->getProperty(dateField));
  } catch (std::invalid_argument &) {
    std::string documentation =
        propertyDocumentation(catalogAlgorithm->getProperties(), dateField);
    errors.emplace(dateField + "_err", documentation);
  }
  return errors;
}
Esempio n. 18
0
TEST(MeshLib, ElementStatus)
{
    const unsigned width (100);
    const unsigned elements_per_side (20);
    auto const mesh = std::unique_ptr<MeshLib::Mesh>{
        MeshLib::MeshGenerator::generateRegularQuadMesh(width, elements_per_side)};

    auto* const material_id_properties =
        mesh->getProperties().createNewPropertyVector<int>(
            "MaterialIDs", MeshLib::MeshItemType::Cell);
    ASSERT_NE(nullptr, material_id_properties);
    material_id_properties->resize(mesh->getNumberOfElements());

    const std::vector<MeshLib::Element*> elements (mesh->getElements());

    for (unsigned i=0; i<elements_per_side; ++i)
    {
        for (unsigned j=0; j<elements_per_side; ++j)
            (*material_id_properties)[elements[i*elements_per_side + j]->getID()] = i;
    }

    {
        // all elements and nodes active
        MeshLib::ElementStatus status(mesh.get());
        ASSERT_EQ (elements.size(), status.getNumberOfActiveElements());
        ASSERT_EQ (mesh->getNumberOfNodes(), status.getNumberOfActiveNodes());
    }

    {
        // set material 1 to false
        std::vector<int> inactiveMat{1};
        MeshLib::ElementStatus status(mesh.get(), inactiveMat);
        ASSERT_EQ (elements.size()-elements_per_side, status.getNumberOfActiveElements());
    }

    {
        // set material 0 and 1 to false
        std::vector<int> inactiveMat{0, 1};
        MeshLib::ElementStatus status(mesh.get(), inactiveMat);
        ASSERT_EQ (elements.size()-(2*elements_per_side), status.getNumberOfActiveElements());

        // active elements
        auto &active_elements (status.getActiveElements());
        ASSERT_EQ (active_elements.size(), status.getNumberOfActiveElements());

        // active nodes
        auto& active_nodes (status.getActiveNodes());
        ASSERT_EQ (active_nodes.size(), status.getNumberOfActiveNodes());
    }
}
KisPaintOpSettingsSP KisPaintOpSettings::clone() const
{
    QString paintopID = getString("paintop");
    if(paintopID.isEmpty())
        return 0;

    KisPaintOpSettingsSP settings = KisPaintOpRegistry::instance()->settings(KoID(paintopID, ""));
    QMapIterator<QString, QVariant> i(getProperties());
    while (i.hasNext()) {
        i.next();
        settings->setProperty(i.key(), QVariant(i.value()));
    }
    return settings;
}
Esempio n. 20
0
RTC::ReturnCode_t AverageFilter::onInitialize()
{
  //std::cout << m_profile.instance_name << ": onInitialize()" << std::endl;
  // <rtc-template block="bind_config">
  // Bind variables and configuration variable
  bindParameter("resolution", m_resolution, "0.01");
  bindParameter("windowSize", m_windowSize, "4");
  bindParameter("dilation", m_dilation, "0");
  
  // </rtc-template>

  // Registration: InPort/OutPort/Service
  // <rtc-template block="registration">
  // Set InPort buffers
  addInPort("originalIn", m_originalIn);

  // Set OutPort buffer
  addOutPort("filteredOut", m_filteredOut);
  
  // Set service provider to Ports
  
  // Set service consumers to Ports
  
  // Set CORBA Service Ports
  
  // </rtc-template>

  RTC::Properties& prop = getProperties();

  m_filtered.height = 1;
  m_filtered.type = "xyz";
  m_filtered.fields.length(3);
  m_filtered.fields[0].name = "x";
  m_filtered.fields[0].offset = 0;
  m_filtered.fields[0].data_type = PointCloudTypes::FLOAT32;
  m_filtered.fields[0].count = 4;
  m_filtered.fields[1].name = "y";
  m_filtered.fields[1].offset = 4;
  m_filtered.fields[1].data_type = PointCloudTypes::FLOAT32;
  m_filtered.fields[1].count = 4;
  m_filtered.fields[2].name = "z";
  m_filtered.fields[2].offset = 8;
  m_filtered.fields[2].data_type = PointCloudTypes::FLOAT32;
  m_filtered.fields[2].count = 4;
  m_filtered.is_bigendian = false;
  m_filtered.point_step = 16;
  m_filtered.is_dense = true;

  return RTC::RTC_OK;
}
Esempio n. 21
0
/**
 * Runs the BinMD algorithm on the input to provide the output workspace
 * All slicing algorithm properties are passed along
 * @return MDHistoWorkspace as a result of the binning
 */
MDHistoWorkspace_sptr MDNormDirectSC::binInputWS() {
  const auto &props = getProperties();
  IAlgorithm_sptr binMD = createChildAlgorithm("BinMD", 0.0, 0.3);
  binMD->setPropertyValue("AxisAligned", "1");
  for (auto it = props.begin(); it != props.end(); ++it) {
    const auto &propName = (*it)->name();
    if (propName != "SolidAngleWorkspace" &&
        propName != "OutputNormalizationWorkspace") {
      binMD->setPropertyValue(propName, (*it)->value());
    }
  }
  binMD->executeAsChildAlg();
  Workspace_sptr outputWS = binMD->getProperty("OutputWorkspace");
  return boost::dynamic_pointer_cast<MDHistoWorkspace>(outputWS);
}
Esempio n. 22
0
	void GLGpuBufferCore::initialize()
	{
		// Create buffer
		const auto& props = getProperties();
		UINT32 size = props.getElementCount() * props.getElementSize();
		mBuffer.initialize(GL_TEXTURE_BUFFER, size, props.getUsage());
		
		// Create texture
		glGenTextures(1, &mTextureID);
		glBindTexture(GL_TEXTURE_BUFFER, mTextureID);
		glTexBuffer(GL_TEXTURE_BUFFER, mFormat, mBuffer.getGLBufferId());

		BS_INC_RENDER_STAT_CAT(ResCreated, RenderStatObject_GpuBuffer);
		GpuBufferCore::initialize();
	}
Esempio n. 23
0
static void openSourcePropertyOfLoader(const ModelNode &modelNode)
{
    QmlDesignerPlugin::instance()->viewManager().nextFileIsCalledInternally();

    QHash<PropertyName, QVariant> propertyHash;

    QString componentFileName = modelNode.variantProperty("source").value().toString();
    QString componentFilePath = modelNode.model()->fileUrl().resolved(QUrl::fromLocalFile(componentFileName)).toLocalFile();

    getProperties(modelNode, propertyHash);
    Core::EditorManager::openEditor(componentFilePath, Core::Id(), Core::EditorManager::DoNotMakeVisible);

    ModelNode rootModelNode = currentDesignDocument()->rewriterView()->rootModelNode();
    applyProperties(rootModelNode, propertyHash);
}
Esempio n. 24
0
void SimulatorService::run()
{
    // push
    auto_ptr<base::net::FilterCreatorStrategyBase> push_ssl_filter;
    string push_pem_file = getProperties().getWithDef<string>("push.pem_file", "");
    push_ssl_filter.reset(new base::net::SSLFilterCreatorStrategy(push_pem_file)); 

    auto_ptr<base::net::HandlerCreatorStrategyBase> push_handler_creator;
    push_handler_creator.reset(new base::net::DefaultHandlerCreatorStrategyT<PushHandler>());

    base::net::Acceptor push_acceptor(getCommunicator().reactor(), base::net::OPT_NODELAY);
    push_acceptor.open(base::net::SockAddr(getProperties().get<string>("push.address")),
            -1, 
            auto_ptr<base::net::HandlerCreatorStrategyBase>(push_handler_creator.release()),
            push_ssl_filter);


    // feedback
    auto_ptr<base::net::FilterCreatorStrategyBase> fb_ssl_filter;
    string fb_pem_file = getProperties().getWithDef<string>("feedback.pem_file", "");
    fb_ssl_filter.reset(new base::net::SSLFilterCreatorStrategy(fb_pem_file)); 

    auto_ptr<base::net::HandlerCreatorStrategyBase> fb_handler_creator;
    fb_handler_creator.reset(new base::net::DefaultHandlerCreatorStrategyT<FeedbackHandler>());

    base::net::Acceptor fb_acceptor(getCommunicator().reactor(), base::net::OPT_NODELAY);
    fb_acceptor.open(base::net::SockAddr(getProperties().get<string>("feedback.address")),
            -1, 
            auto_ptr<base::net::HandlerCreatorStrategyBase>(fb_handler_creator.release()),
            fb_ssl_filter);

    LOG(info, "\n\n====== server start ("
            << getServiceType() << "_" << getServiceNumber() << "@" << getServiceDomain()                                                                                               
            << ") ======\n\n");
    waitForShutdown();
}
Esempio n. 25
0
void Processor::initialize() throw (tgt::Exception) {
    if(description_ == "")
        setDescriptions();

    if (!VoreenApplication::app()) {
        LERROR("VoreenApplication not instantiated");
        throw VoreenException("VoreenApplication not instantiated");
    }

    if (isInitialized()) {
        LWARNING("initialize(): '" << getID() << "' already initialized");
        return;
    }

    bool glMode = VoreenApplication::app() && VoreenApplication::app()->isInitializedGL();
    if (!glMode)
        LDEBUG("initialize() not in OpenGL mode");

    // create and initialize processor widget
    processorWidget_ = VoreenApplication::app()->createProcessorWidget(this);
    if (processorWidget_) {
        processorWidget_->initialize();
        if (glMode)
            LGL_ERROR;
        // inform the observers about the new widget
        std::vector<ProcessorObserver*> observers = Observable<ProcessorObserver>::getObservers();
        for (size_t i = 0; i < observers.size(); ++i)
            observers[i]->processorWidgetCreated(this);
    }


    // initialize ports
    const std::vector<Port*>& ports = getPorts();
    for (size_t i=0; i < ports.size(); ++i) {
        if (!ports[i]->isInitialized())
            ports[i]->initialize();
        if (glMode)
            LGL_ERROR;
    }

    // initialize properties
    const std::vector<Property*>& properties = getProperties();
    for (size_t i=0; i < properties.size(); ++i) {
        properties[i]->initialize();
        if (glMode)
            LGL_ERROR;
    }
}
Esempio n. 26
0
_Tt_db_results _Tt_db_file::copy (const _Tt_string &new_file)
{
  if (!new_file.len()) {
    return (dbResults = TT_DB_ERR_ILLEGAL_FILE);
  }

  if (isFileInDatabase()) {
    _Tt_string new_local_path;
    _Tt_string new_hostname;
    _Tt_string new_partition;
    _Tt_string new_network_path;
    dbResults = _tt_db_network_path(new_file,
				    new_local_path,
				    new_hostname,
				    new_partition,
				    new_network_path);

    if (dbResults == TT_DB_OK) {
      // If we're not copying to the exact same file
      if (dbFileNetworkPath != new_network_path) {
        setCurrentDBAccess();
        _Tt_db_property_list_ptr properties = getProperties();
        _Tt_db_access_ptr        access = getAccess ();
        _Tt_string_list_ptr      objids = getObjects();

        if (dbResults == TT_DB_OK) {
	  _Tt_db_file_ptr new_db_file = new _Tt_db_file(new_network_path,
						        properties,
						        access);

	  _Tt_string_list_cursor objids_cursor(objids);
	  while (objids_cursor.next()) {
	    _Tt_db_object_ptr object = new _Tt_db_object(*objids_cursor);
	    (void)object->copy(new_file);
	  }
        }
      }
      else {
        dbResults = TT_DB_ERR_SAME_FILE;
      }
    }
  }
  else {
    dbResults = TT_DB_ERR_ILLEGAL_FILE;
  }

  return dbResults;
}
Esempio n. 27
0
bool Inst::getPureDefProperty() const {
    if (getProperties() & Properties_PureDef) {
        assert(getOpndCount(OpndRole_InstLevel|OpndRole_Use)==2);
        Opnd * use = NULL;
        for (U_32 i=0, n=getOpndCount(); i<n; i++){
            if (getOpndRoles(i)&OpndRole_Use) {
                if(!use) {
                   use = getOpnd(i);
                } else {            
                    return use == getOpnd(i);
                }
            }
        }
    }
    return false;
}
Esempio n. 28
0
void GameMap::onMapLoadCompleted(){
	auto map = this->_map;
	if (map == NULL){
		log("error: map is null");
		return;
	}

	ValueMap properties = map->getProperties();
	if (properties == ValueMapNull){ return; }

	int triggerPlotId = properties.at("triggerPlotId").asInt();
	if (triggerPlotId != 0 && dialogueManager != NULL){
		//触发对话事件
		triggerPlot(triggerPlotId);
	}
}
Esempio n. 29
0
TR::MemoryReference *TR::ARMSystemLinkage::getOutgoingArgumentMemRef(int32_t               totalSize,
                                                                      int32_t               offset,
                                                                      TR::Register          *argReg,
                                                                      TR_ARMOpCodes         opCode,
                                                                      TR::ARMMemoryArgument &memArg)
   {
   int32_t                spOffset = offset - (getProperties().getNumIntArgRegs() * TR::Compiler->om.sizeofReferenceAddress());
   TR::RealRegister    *sp       = cg()->machine()->getRealRegister(properties.getStackPointerRegister());
   TR::MemoryReference *result   = new (trHeapMemory()) TR::MemoryReference(sp, spOffset, cg());

   memArg.argRegister = argReg;
   memArg.argMemory   = result;
   memArg.opCode      = opCode;

   return result;
   }
Esempio n. 30
0
RTC::ReturnCode_t Range2PointCloud::onInitialize()
{
  std::cout << m_profile.instance_name << ": onInitialize()" << std::endl;
  // <rtc-template block="bind_config">
  // Bind variables and configuration variable
  
  // </rtc-template>

  // Registration: InPort/OutPort/Service
  // <rtc-template block="registration">
  // Set InPort buffers
  addInPort("range", m_rangeIn);

  // Set OutPort buffer
  addOutPort("cloud", m_cloudOut);
  
  // Set service provider to Ports
  
  // Set service consumers to Ports
  
  // Set CORBA Service Ports
  
  // </rtc-template>

  RTC::Properties& prop = getProperties();

  m_cloud.height = 1;
  m_cloud.type = "xyz";
  m_cloud.fields.length(3);
  m_cloud.fields[0].name = "x";
  m_cloud.fields[0].offset = 0;
  m_cloud.fields[0].data_type = PointCloudTypes::FLOAT32;
  m_cloud.fields[0].count = 4;
  m_cloud.fields[1].name = "y";
  m_cloud.fields[1].offset = 4;
  m_cloud.fields[1].data_type = PointCloudTypes::FLOAT32;
  m_cloud.fields[1].count = 4;
  m_cloud.fields[2].name = "z";
  m_cloud.fields[2].offset = 8;
  m_cloud.fields[2].data_type = PointCloudTypes::FLOAT32;
  m_cloud.fields[2].count = 4;
  m_cloud.is_bigendian = false;
  m_cloud.point_step = 16;
  m_cloud.is_dense = true;

  return RTC::RTC_OK;
}