コード例 #1
0
void
LineoutAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("LineoutAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("point1")) != 0)
        SetPoint1(node->AsDoubleArray());
    if((node = searchNode->GetNode("point2")) != 0)
        SetPoint2(node->AsDoubleArray());
    if((node = searchNode->GetNode("interactive")) != 0)
        SetInteractive(node->AsBool());
    if((node = searchNode->GetNode("ignoreGlobal")) != 0)
        SetIgnoreGlobal(node->AsBool());
    if((node = searchNode->GetNode("samplingOn")) != 0)
        SetSamplingOn(node->AsBool());
    if((node = searchNode->GetNode("numberOfSamplePoints")) != 0)
        SetNumberOfSamplePoints(node->AsInt());
    if((node = searchNode->GetNode("reflineLabels")) != 0)
        SetReflineLabels(node->AsBool());
    if((node = searchNode->GetNode("designator")) != 0)
        SetDesignator(node->AsString());
}
コード例 #2
0
ファイル: lwf_event.cpp プロジェクト: RichardGale/lwf
int LWF::AddButtonEventHandler(string instanceName,
                               const ButtonEventHandlerDictionary &h, ButtonKeyPressHandler kh)
{
    if (h.empty())
        return -1;

    int instId = SearchInstanceId(GetStringId(instanceName));
    if (instId >= 0)
        return AddButtonEventHandler(instId, h, kh);

    if (instanceName.find('.') == string::npos)
        return -1;

    SetInteractive();

    ButtonEventHandlersDictionary::iterator it =
        m_buttonEventHandlersByFullName.find(instanceName);
    if (it == m_buttonEventHandlersByFullName.end()) {
        m_buttonEventHandlersByFullName[instanceName] = ButtonEventHandlers();
        it = m_buttonEventHandlersByFullName.find(instanceName);
    }
    int id = GetEventOffset();
    it->second.Add(id, h, kh);

    Button *b = SearchButtonInstance(instId);
    if (b)
        b->AddHandlers(&it->second);

    return id;
}
コード例 #3
0
ファイル: lwf_event.cpp プロジェクト: 435886030/lwf
int LWF::AddButtonEventHandler(
	int instId, const ButtonEventHandlerDictionary &h, ButtonKeyPressHandler kh)
{
	if (instId < 0 || instId >= (int)data->instanceNames.size())
		return -1;

	SetInteractive();

	int id = GetEventOffset();
	m_buttonEventHandlers[instId].Add(id, h, kh);

	Button *b = SearchButtonInstanceByInstanceId(instId);
	if (b)
		b->AddHandlers(&m_buttonEventHandlers[instId]);

	return id;
}
コード例 #4
0
void
ThreeSliceAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("ThreeSliceAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("x")) != 0)
        SetX(node->AsDouble());
    if((node = searchNode->GetNode("y")) != 0)
        SetY(node->AsDouble());
    if((node = searchNode->GetNode("z")) != 0)
        SetZ(node->AsDouble());
    if((node = searchNode->GetNode("interactive")) != 0)
        SetInteractive(node->AsBool());
}