Ejemplo n.º 1
0
// -----------------------------------------------------------------------------
ARTremolo::ARTremolo(const ARTremolo * tremolo)	: ARMTParameter(-1, tremolo)
{
	rangesetting = ONLY;
	setAssociation(ARMusicalTag::RA);

	dx = dy = fThickness = 0;
	fStyle = NULL;
	fSpeed = NULL;
	fPitch = NULL;
	fText = NULL;
	
	mParSet = false;


	if(tremolo->fStyle)
		fStyle = TagParameterString::cast( tremolo->fStyle->getCopy());
	if(tremolo->fSpeed)
		fSpeed = TagParameterInt::cast( tremolo->fSpeed->getCopy());
	if(tremolo->fPitch)
		fPitch = TagParameterString::cast( tremolo->fPitch->getCopy());
	if(tremolo->dx)
		dx = TagParameterFloat::cast( tremolo->dx->getCopy());
	if(tremolo->dy)
		dy = TagParameterFloat::cast( tremolo->dy->getCopy());
	if(tremolo->fThickness)
		fThickness = TagParameterFloat::cast( tremolo->fThickness->getCopy());
	if(tremolo->fText)
		fText = TagParameterString::cast( tremolo->fText->getCopy());
}
Ejemplo n.º 2
0
ARTuplet::ARTuplet() : fTupletFormat(""), fPosition(""), fDy1(0), fDy2(0), fLineThickness(0.08f * LSPACE),
    fTextBold(false), fTextSize(1), fDispNote(""), fFormatSet(false), fDy1TagIsSet(false), fDy2TagIsSet(false)
{
	rangesetting = ONLY;
	setAssociation(ARMusicalTag::RA);
	
	fBaseNumerator   = 0;	// 0 means: do not display
	fBaseDenominator = 0;	// 0 means: do not display
	fLeftBrace       = false;
	fRightBrace      = false;
	fPositionIsSet	 = false;
}
Ejemplo n.º 3
0
ARTremolo::ARTremolo()
{
	rangesetting = ONLY;
	setAssociation(ARMusicalTag::RA);
	
	dx = dy = fThickness = 0;
	fStyle = NULL;
	fSpeed = NULL;
	fPitch = NULL;
	fText = NULL;

	mParSet = false;
}
Ejemplo n.º 4
0
//-------------------------
//object types
//set type of eCopy according to type of eOrig
void PlanRep::setCopyType(edge eCopy, edge eOrig)
{
	OGDF_ASSERT(original(eCopy) == eOrig)
	m_eType[eCopy] = m_pGraphAttributes ? m_pGraphAttributes->type(eOrig) : Graph::association;
	if (eOrig)
	{
		switch (m_pGraphAttributes ? m_pGraphAttributes->type(eOrig) : Graph::association)
		{
			case Graph::generalization: setGeneralization(eCopy); break;
			case Graph::association: setAssociation(eCopy); break;
			case Graph::dependency: setDependency(eCopy); break;
			OGDF_NODEFAULT
		}//switch
	}//if original
}//setCopyType
Ejemplo n.º 5
0
void
FileAssociation::initAssociations ()
{
	int i;

	cExtension->removeAll ();

	for (i = 0; i < 16; i++)
		d_associations[i].association = -1;

	char path[256];
	strcpy (path, mx::getApplicationPath ());
	strcat (path, "/hlmv.fa");
	FILE *file = fopen (path, "rt");
	if (!file)
		return;

	i = 0;
	char line[256];
	while (i < 16 && fgets (line, 256, file))
	{
		int j = 0;
		while (line[++j] != '\"');
		line[j] = '\0';
		strcpy (d_associations[i].extension, &line[1]);

		while (line[++j] != '\"');
		int k = j + 1;
		while (line[++j] != '\"');
		line[j] = '\0';
		strcpy (d_associations[i].program, &line[k]);

		d_associations[i].association = atoi (&line[++j]);

		cExtension->add (d_associations[i].extension);
		++i;
	}

	fclose (file);

	setAssociation (0);
}
Ejemplo n.º 6
0
//activates a cc, if minnode==true, at least one node is inserted
node PlanRepInc::initActiveCCGen(int i, bool minNode)
{
	//node to be returned
	node minActive = nullptr;
	//list to be filled wih activated nodes
	List<node> activeOrigCCNodes;
	// a) delete copy / chain fields for originals of nodes in current cc,
	// since we change the CC number...
	// (since we remove all these copies in initByNodes(...)
	// b) create list of currently active original nodes

	for(int j = m_ccInfo.startNode(i); j < m_ccInfo.stopNode(i); ++j)
	{
		node vG = m_ccInfo.v(j);

		if (m_activeNodes[vG])
			activeOrigCCNodes.pushBack(vG);

		if (m_currentCC >= 0)
		{
			m_vCopy[vG] = nullptr;

			for(adjEntry adj : vG->adjEdges)
			{
				if ((adj->index() & 1) == 0) continue;
				edge eG = adj->theEdge();

				m_eCopy[eG].clear();
			}
		}
	}//for originals
	//}//if non-empty

	//now we check if we have to activate a single node
	if (minNode)
	{
		if (activeOrigCCNodes.size() == 0)
		{
			//Simple strategy: take the first node
			minActive = m_ccInfo.v(m_ccInfo.startNode(i));
			if (minActive != nullptr)
			{
				m_activeNodes[minActive] = true;
				activeOrigCCNodes.pushFront(minActive);
			}
		}
	}//minNode

	m_currentCC = i;

	//double feature: liste und nodearray, besser
	GraphCopy::initByActiveNodes(activeOrigCCNodes, m_activeNodes, m_eAuxCopy);

	// set type of edges (gen. or assoc.) in the current CC
	if (m_pGraphAttributes->attributes() & GraphAttributes::edgeType)
		for(edge e : edges)
		{
			m_eType[e] = m_pGraphAttributes->type(original(e));
			if (original(e))
			{
				switch (m_pGraphAttributes->type(original(e)))
				{
					case Graph::generalization: setGeneralization(e); break;
					case Graph::association: setAssociation(e); break;
					OGDF_NODEFAULT
				}//switch
			}//if original
		}

	if (m_pGraphAttributes->attributes() & GraphAttributes::nodeType)
		for(node v : nodes)
			m_vType[v] = m_pGraphAttributes->type(original(v));
	//TODO:check only in CCs or global?
	m_treeInit = false;
	return minActive;

}//initActiveCC
Ejemplo n.º 7
0
int
FileAssociation::handleEvent (mxEvent *event)
{
	if (event->event != mxEvent::Action)
		return 0;

	switch (event->action)
	{
	case IDC_EXTENSION:
	{
		int index = cExtension->getSelectedIndex ();
		if (index >= 0)
			setAssociation (index);
	}
	break;

	case IDC_ACTION1:
	case IDC_ACTION2:
	case IDC_ACTION3:
	case IDC_ACTION4:
	{
		leProgram->setEnabled (rbAction[0]->isChecked ());
		bChooseProgram->setEnabled (rbAction[0]->isChecked ());

		int index = cExtension->getSelectedIndex ();
		if (index >= 0)
			d_associations[index].association = event->action - IDC_ACTION1;
		
	}
	break;

	case IDC_PROGRAM:
	{
		int index = cExtension->getSelectedIndex ();
		if (index >= 0)
			strcpy (d_associations[index].program, leProgram->getLabel ());
	}
	break;

	case IDC_CHOOSEPROGRAM:
	{
		const char *ptr = mxGetOpenFileName (this, 0, "*.exe");
		if (ptr)
		{
			leProgram->setLabel (ptr);

			int index = cExtension->getSelectedIndex ();
			if (index >= 0)
				strcpy (d_associations[index].program, leProgram->getLabel ());
		}
	}
	break;

	case IDC_OK:
		saveAssociations ();

	case IDC_CANCEL:
		setVisible (false);
		break;
	}

	return 1;
}
Ejemplo n.º 8
0
void PlanRep::expand(bool lowDegreeExpand)
{
	for(node v : nodes)
	{

		// Replace vertices with high degree by cages and
		// replace degree 4 vertices with two generalizations
		// adjacent in the embedding list by a cage.
		if ((v->degree() > 4)  && (typeOf(v) != Graph::dummy) && !lowDegreeExpand)
		{
			edge e;

			//Set the type of the node v. It remains in the graph
			// as one of the nodes of the expanded face.
			typeOf(v) = Graph::highDegreeExpander;

			// Scan the list of edges of v to find the adjacent edges of v
			// according to the planar embedding. All except one edge
			// will get a new adjacent node
			SList<edge> adjEdges;
			{forall_adj_edges(e,v)
				adjEdges.pushBack(e);
			}

			//The first edge remains at v. remove it from the list.
			e = adjEdges.popFrontRet();

			// Create the list of high degree expanders
			// We need degree(v)-1 of them to construct a face.
			// and set expanded Node to v
			setExpandedNode(v, v);
			SListPure<node> expander;
			for (int i = 0; i < v->degree()-1; i++)
			{
				node u = newNode();
				typeOf(u) = Graph::highDegreeExpander;
				setExpandedNode(u, v);
				expander.pushBack(u);
			}

			// We move the target node of each ingoing generalization of v to a new
			// node stored in expander.
			// Note that, for each such edge e, the target node of the original
			// edge is then different from the original of the target node of e
			// (the latter is 0 because u is a new (dummy) node)
			SListConstIterator<node> itn;

			NodeArray<adjEntry> ar(*this);

			itn = expander.begin();

			for (edge ei : adjEdges)
			{
				// Did we allocate enough dummy nodes?
				OGDF_ASSERT(itn.valid());

				if (ei->source() == v)
					moveSource(ei,*itn);
				else
					moveTarget(ei,*itn);
				ar[*itn] = (*itn)->firstAdj();
				++itn;
			}
			ar[v] = v->firstAdj();

			// Now introduce the circular list of new edges
			// forming the border of the merge face. Keep the embedding.
			adjEntry adjPrev = v->firstAdj();

//			cout <<endl << "INTRODUCING CIRCULAR EDGES" << endl;
			for (node n : expander)
			{
//				cout << adjPrev << " " << (*itn)->firstAdj() << endl;
				e = Graph::newEdge(adjPrev,n->firstAdj());
				setExpansionEdge(e, 2);//can be removed if edgetypes work properly

				setExpansion(e);
				setAssociation(e);

				typeOf(e) = association; //???

				if (!expandAdj(v))
					expandAdj(v) = e->adjSource();
				adjPrev = n->firstAdj();
			}

			e = newEdge(adjPrev,v->lastAdj());

			typeOf(e) = association; //???
			setExpansionEdge(e, 2);//can be removed if edgetypes work properly
			setAssociation(e);

		}//highdegree

		// Replace all vertices with degree > 2 by cages.
		else if (v->degree() >= 2  && typeOf(v) != Graph::dummy &&
				 lowDegreeExpand)
		{
			edge e;

			//Set the type of the node v. It remains in the graph
			// as one of the nodes of the expanded face.
			typeOf(v) = Graph::lowDegreeExpander; //high??

			// Scan the list of edges of v to find the adjacent edges of v
			// according to the planar embedding. All except one edge
			// will get a new adjacent node
			SList<edge> adjEdges;
			{forall_adj_edges(e,v)
				adjEdges.pushBack(e);
			}

			//The first edge remains at v. remove it from the list.
			// Check if it is a generalization.
			e = adjEdges.popFrontRet();

			// Create the list of high degree expanders
			// We need degree(v)-1 of them to construct a face.
			// and set expanded Node to v
			setExpandedNode(v, v);
			SListPure<node> expander;
			for (int i = 0; i < v->degree()-1; i++)
			{
				node u = newNode();
				typeOf(u) = Graph::highDegreeExpander;
				setExpandedNode(u, v);
				expander.pushBack(u);
			}

			// We move the target node of each ingoing generalization of v to a new
			// node stored in expander.
			// Note that, for each such edge e, the target node of the original
			// edge is then different from the original of the target node of e
			// (the latter is 0 because u is a new (dummy) node)

			NodeArray<adjEntry> ar(*this);

			SListConstIterator<node> itn = expander.begin();

			for (edge ei : adjEdges)
			{
				// Did we allocate enough dummy nodes?
				OGDF_ASSERT(itn.valid());

				if (ei->source() == v)
					moveSource(ei,*itn);
				else
					moveTarget(ei,*itn);
				ar[*itn] = (*itn)->firstAdj();
				++itn;
			}
			ar[v] = v->firstAdj();

			// Now introduce the circular list of new edges
			// forming the border of the merge face. Keep the embedding.
			adjEntry adjPrev = v->firstAdj();

			for (node n : expander)
			{
				e = newEdge(adjPrev,n->firstAdj());
				if (!expandAdj(v)) expandAdj(v) = e->adjSource();
				typeOf(e) = association; //???
				setExpansionEdge(e, 2);

				//new types
				setAssociation(e); //should be dummy type?
				setExpansion(e);

				adjPrev = n->firstAdj();
			}
			e = newEdge(adjPrev,v->lastAdj());
			typeOf(e) = association; //???
			setExpansionEdge(e, 2);
		}

	}

}//expand