void layprop::SupplementaryData::tmp_draw(const TP& base, const TP& newp, real UU, const CTM& LayCTM, const real _step) { if (_tmp_base) { DBline long_mark, short_mark, text_bp; double scaledpix; getConsts(LayCTM, long_mark, short_mark, text_bp, scaledpix); SDLine* tmp_ruler = DEBUG_NEW SDLine(base, newp, UU); tmp_ruler->draw(long_mark, short_mark, text_bp, scaledpix, _step); delete tmp_ruler; } }
void layprop::SupplementaryData::addRuler(TP& p1, TP& p2, real UU) { _rulers.push_front(SDLine(p1,p2,UU)); }
/** @brief 説明、引数、戻り値はMonapi2リファレンス参照。 @date 2005/08/20 junjunn 作成 */ void IniManager::parse(cpchar1 cszContent) { m_strCurDir.empty(); //行に分割 StringDivide SDLine(cszContent,"\n"); //行を巡回 for (uint i=0;i<SDLine.getCount();i++) { //現在の行。 cpchar1 pLine = SDLine.getAt(i); //コメント行ならスキップ if (isLineComment(pLine)) continue; //ディレクトリ指定の行らしい if (pLine[0]=='[') { //ディレクトリ名の初めと終わり。 cpchar1 pStart = pLine+1; cpchar1 pEnd = StringFn::find(pLine,']'); if (pEnd==NULL) pEnd = StringFn::getEnd(pStart); //閉じカッコがないのはおかしいがなんとか修正する。 m_strCurDir.copy(pStart,pEnd-pStart); } //値 else { //Key=Value形式を区切る。 StringDivide SDKeyValue(pLine,"="); //キー名 String strKey=SDKeyValue.getAt(0); //先頭の空白を取り除く。 strKey.remove(" "); //空白 strKey.remove(" "); //タブ //値 String strValue; if (SDKeyValue.getCount()>=2) { // strTest= "a=b"; //など値にも=が入ってしまっている困ったケースを考慮して残りを一つにくっつける。 String strValueUnified=SDKeyValue.getAt(1); for (uint i=2;i<SDKeyValue.getCount();i++) { strValueUnified+="="; strValueUnified+=SDKeyValue.getAt(i); } //先頭を見つける。 cpchar1 pStart = strValueUnified; //先頭の空白をスキップ。 while (*pStart==' ' || *pStart==' ') pStart++; //最後を見つける。 cpchar1 pEnd=pStart; //="〜"形式だったら対応する"を見つける。 if (*pStart=='"') { pStart++; pEnd=StringFn::find(pStart,'"'); if (pEnd==NULL) pEnd = StringFn::getEnd(pStart+1); //閉じカッコがないのはおかしいがなんとか修正する。 } //=〜形式だったら;か行の終わりを見つける。 else { while (! (*pEnd==';' || *pEnd=='\0')) pEnd++; } //値を取り出す。 int iLen=pEnd-pStart; pchar1 pBuffer=(pchar1)strValue.extendBuffer(iLen+1); StringFn::copy(pBuffer,pStart,iLen); } //ディレクトリ+キー名で作るフルキー名。 String strKeyWhole; strKeyWhole.format("%s/%s",m_strCurDir.getString(),strKey.getString()); m_strstrmap.setAt(strKeyWhole,strValue); } } }