Ejemplo n.º 1
0
void boundaryArea::updateConnection()
{
	//コントロールポイントのアップデート
	controlPoints.release();
	for ( list<boundaryCurve>::iterator it( divisions ); it; ++it ) {
		for ( list<boundaryPoint>::iterator itp( it->points ); itp; ++itp ) {
			if ( ! itp->referencing() ) controlPoints.push_back( & itp() );
		}
	}
	touch( -1 );
}
Ejemplo n.º 2
0
void UmlItem::write_stereotyped(FileOut & out)
{
    QMap<QString, Q3PtrList<UmlItem> >::Iterator it;

    for (it = _stereotypes.begin(); it != _stereotypes.end(); ++it) {
        const char * st = it.key();
        UmlClass * cl = UmlClass::findStereotype(it.key(), TRUE);

        if (cl != 0) {
            Q3ValueList<WrapperStr> extended;

            cl->get_extended(extended);

            Q3PtrList<UmlItem> & l = it.data();
            UmlItem * elt;

            for (elt = l.first(); elt != 0; elt = l.next()) {
                out << "\t<" << st;
                out.id_prefix(elt, "STELT_");

                const Q3Dict<WrapperStr> props = elt->properties();
                Q3DictIterator<WrapperStr> itp(props);

                while (itp.current()) {
                    QString k = itp.currentKey();

                    if (k.contains(':') == 2) {
                        out << " ";
                        out.quote((const char *)k.mid(k.findRev(':') + 1)); //[jasa] ambiguous call
                        out << "=\"";
                        out.quote((const char *)*itp.current());
                        out << '"';
                    }

                    ++itp;
                }

                Q3ValueList<WrapperStr>::Iterator iter_extended;

                for (iter_extended = extended.begin();
                        iter_extended != extended.end();
                        ++iter_extended) {
                    WrapperStr vr = "base_" + *iter_extended;

                    out.ref(elt, vr);
                }

                out << "/>\n";

                elt->unload();
            }
        }
    }

}
Ejemplo n.º 3
0
Archivo: Glob.cpp Proyecto: 119/vdc
bool Glob::match(const std::string& subject)
{
	UTF8Encoding utf8;
	TextIterator itp(_pattern, utf8);
	TextIterator endp(_pattern);
	TextIterator its(subject, utf8);
	TextIterator ends(subject);
	
	if ((_options & GLOB_DOT_SPECIAL) && its != ends && *its == '.' && (*itp == '?' || *itp == '*'))
		return false;
	else
		return match(itp, endp, its, ends);
}
Ejemplo n.º 4
0
void State::throw_on_illegal_move(const PlayerMove& pm,
                                  boost::unordered_map<Player, boost::unordered_set<Move> >& legals) const
{
    typedef boost::unordered_map<Player, boost::unordered_set<Move> > tmp_t;
    const Player& p = pm.first;
    const Move& m = pm.second;

    tmp_t::const_iterator itp(legals.find(p));
    if (itp == legals.end())
    {
        throw HSFCValueError() << ErrorMsgInfo("Illegal PlayerMove: unknown player");
    }
    boost::unordered_set<Move>::const_iterator itm(itp->second.find(m));
    if (itm == itp->second.end())
    {
        throw HSFCValueError() << ErrorMsgInfo("Illegal PlayerMove: unknown move");
    }
}
Ejemplo n.º 5
0
void boundaryPoint::update( bool local, bool edit, bool force )
{
	if ( reference ) return;
	trackDocument * doc = trackDocument::get();
	if ( ! doc ) return;
	const array<int> & wave = doc->wave;
	int initialCount = 0;
	int editedCount = 0;
	point2<int> initialPoint;
	bool adjusted = true;
	int i = 0;
	for ( array<boundaryPointFrame>::iterator itp( points ); itp; ++itp ) {
		if ( ! itp->adjusted ) {
			adjusted = false;
		}
		switch ( itp->type ) {
		case boundaryPointFrame::typeInterpolated:
			break;
		case boundaryPointFrame::typeInitial:
			initialPoint = itp->position;
			++initialCount;
			break;
		case boundaryPointFrame::typeEdited:
			++editedCount;
			break;
		}
		++i;
	}
	if ( adjusted && ( ! force ) ) return;
	if ( initialCount != 1 ) return;//データエラー
	if ( local && ( ! force ) ) {
		for ( int i = 0; i < points.size; ++i ) {
			points[i].adjusted = true;
		}
	} else {
		if ( ( edit && points[doc->currentViewImageIndex].type == boundaryPointFrame::typeInitial ) ||
			( ( ! edit ) ) ) {//解析解を用いる
			point2<int> p = initialPoint;
			point2<double> c = doc->analysis( p );
			//point2<double> c = doc->analysisBearings( p );//前処理が無い場合はこちら
			for ( int i = 0; i < points.size; ++i ) {
				points[i].adjusted = true;
				if ( points[i].type == boundaryPointFrame::typeInterpolated ) {
					points[i].position.x = p.x + c.x * wave[i];
					points[i].position.y = p.y + c.y * wave[i];
				}
			}
		} else if ( points[doc->currentViewImageIndex].type == boundaryPointFrame::typeEdited ) {//設定解を用いる
			if ( wave[doc->currentViewImageIndex] ) {//解が求まる
				// wave[editedIndex] * c + now = edited
				// c = ( edited - now ) / wave[editedIndex]
				point2<double> c;
				point2<int> ep = points[doc->currentViewImageIndex].position;
				point2<int> p = initialPoint;
				c.x = ( ep.x - p.x ) / double( wave[doc->currentViewImageIndex] );
				c.y = ( ep.y - p.y ) / double( wave[doc->currentViewImageIndex] );
				for ( int i = 0; i < points.size; ++i ) {
					points[i].adjusted = true;
					if ( points[i].type == boundaryPointFrame::typeInterpolated ) {
						points[i].position.x = p.x + c.x * wave[i];
						points[i].position.y = p.y + c.y * wave[i];
					}
				}
			}
		}
	}
}
Ejemplo n.º 6
0
void boundaryArea::update( int timeIndex )
{	
	//境界の点列の作成
	for ( int time = 0; time < shapes.size; ++time ) {
		if ( timeIndex != -1 ) {
			time = timeIndex;
		}
		if ( ! valid[time] ) {
			boundaryCurves[time].release();
			for ( list<boundaryCurve>::iterator it( divisions ); it; ++it ) {
				int index = 0;
				for ( list<boundaryPoint>::iterator itp( it->points ); itp; ++itp ) {
					it->segment( boundaryCurves[time], index, time );
					++index;
				}
			}
		}
		if ( timeIndex != -1 ) {
			break;
		}
	}

	if ( ! enable ) return;

	//各領域のアップデート
	for ( int time = 0; time < shapes.size; ++time ) {
		if ( timeIndex != -1 ) {
			time = timeIndex;
		}
		if ( ! valid[time] ) {
			//全体の領域のアップデート
			if ( ! divisions.empty() ) {
				boundaryCurve & circumference = divisions.first();
				region<int> shape;
				for ( int index = 0; index < circumference.points.size; ++index ) {
					list< point2<int> > seg;
					circumference.segment( seg, index, time );
					region<int> segshape;
					for ( list< point2<int> >::iterator itp( seg ); itp; ++itp ) {
						segshape |= region<int>( itp() );
					}
					shape |= segshape;
				}
				shape.fill( shapes[time] );
			}
			for ( list<boundaryPart>::iterator it( parts ); it; ++it ) {
				it->update( this, time );
			}
			//各領域の調整
			region<int> & wholeshape = shapes[time];
			region<int> rest = wholeshape;
			for ( list<boundaryPart>::iterator it( parts ); it; ++it ) {
				it->shapes[time] = rest & it->shapes[time];
				rest -= it->shapes[time];
			}
			wholeshape -= rest;
			valid[time] = true;
		}
		if ( timeIndex != -1 ) {
			break;
		}
	}
}
Ejemplo n.º 7
0
/*!
 * \brief IPProcessGrid::execute
 */
void IPProcessGrid::execute(bool forcedUpdate /* = false*/)
{
    // if no processes yet, then exit
    if(_scene->steps()->size() < 1)
    {
        return;
    }

    // if already running or nothing has changed, exit
    if(_isRunning || !_updateNeeded)
    {
        return;
    }
    // prevent user changes during execution
    _mainWindow->lockScene();
    _isRunning = true;
    _sequenceCount = 0;

    buildQueue();

    int totalDurationMs = 0;

    // execute the processes
    int counter = 0;
    int limit = 10000;
    bool blockFailLoop = false;

    QList<IPProcessStep*> afterProcessingList;

    QListIterator<IPProcessStep *> it(_processList);
    while (it.hasNext() && counter < limit)
    {
        if(_stopExecution)
            return;

        IPProcessStep* step = it.next();
        _currentStep = step;

        // make sure the progress bar gets filled
        updateProgress(1);

        // source processes don't have inputs
        if(step->process()->isSource())
        {
            // check if is sequence
            //IPLLoadImageSequence* sequenceProcess = dynamic_cast<IPLLoadImageSequence*>(step->process());

            // update if index has changed
            /*if(sequenceProcess && (_sequenceIndex != _lastSequenceIndex))
            {
                sequenceProcess->setSequenceIndex(_sequenceIndex);
                propagateNeedsUpdate(sequenceProcess);
            }*/

            // execute thread
            if(!step->process()->isResultReady() || forcedUpdate)
            {
                step->process()->resetMessages();
                step->process()->beforeProcessing();
                int durationMs = executeThread(step->process());
                if ( _lastProcessSuccess ) blockFailLoop = true;
                //step->process()->afterProcessing();

                // afterProcessing will be called later
                afterProcessingList.append(step);

                totalDurationMs += durationMs;
                step->setDuration(durationMs);

                if(!step->process()->hasErrors())
                    step->updateThumbnail();

                // update error messages
                _mainWindow->updateProcessMessages();
            }

            /*if(sequenceProcess)
            {
                int currentSequenceCount = sequenceProcess->sequenceCount();
                _sequenceCount = std::max(_sequenceCount, currentSequenceCount);
                emit sequenceChanged(_sequenceIndex, _sequenceCount);
            }*/
        }
        else
        {
            if(!step->process()->isResultReady() || forcedUpdate)
            {
                // execute process once for every input
                for(int i=0; i < step->edgesIn()->size(); i++)
                {
                    IPProcessEdge* edge = step->edgesIn()->at(i);
                    int indexFrom = edge->indexFrom();
                    int indexTo = edge->indexTo();
                    IPProcessStep* stepFrom = edge->from();

                    IPLImage* result = static_cast<IPLImage*>(stepFrom->process()->getResultData(indexFrom));

                    // invalid result, stopp the execution
                    if(!result)
                    {
                        QString msg("Invalid operation at step: ");
                        msg.append(QString::fromStdString(stepFrom->process()->title()));
                        _mainWindow->showMessage(msg, MainWindow::MESSAGE_ERROR);
                        break;
                    }

                    // execute thread
                    step->process()->resetMessages();
                    step->process()->beforeProcessing();
                    int durationMs = executeThread(step->process(), result, indexTo, mainWindow()->useOpenCV());
                    if ( !_lastProcessSuccess ) blockFailLoop = true;
                    //step->process()->afterProcessing();

                    // afterProcessing will be called later
                    afterProcessingList.append(step);

                    totalDurationMs += durationMs;
                    step->setDuration(durationMs);

                    step->updateThumbnail();

                    // update error messages
                    _mainWindow->updateProcessMessages();
                }
            }
        }

        // make sure the progress bar gets filled
        updateProgress(100);

        counter++;
    }

    if(_stopExecution)
        return;

    // update images
    _mainWindow->imageViewer()->updateImage();
    _mainWindow->imageViewer()->showProcessDuration(totalDurationMs);


    // update process graph
    _mainWindow->updateGraphicsView();
    _mainWindow->unlockScene();

    _isRunning = false;
    _currentStep = NULL;

    // if sequence, then run execute next step
    /*if(_sequenceCount > 0)
    {
        // notify GUI
        emit sequenceChanged(_sequenceIndex, _sequenceCount);

        if(_isSequenceRunning)
        {
            //setParamsHaveChanged();
            _mainWindow->execute(true);
        }
    }

    // find sequence processes
    //bool graphNeedsUpdate = false;
    for(auto it = _scene->steps()->begin(); it < _scene->steps()->end(); ++it)
    {
        IPProcessStep* step = (IPProcessStep*) *it;
        IPLProcess* process = step->process();

        if(process->isSequence())
        {
            process->requestUpdate();
            propertyChanged(process);
            requestUpdate();
        }
    }*/

    //if(_updateID > _currentUpdateID)
    //    _mainWindow->execute(false);

    // only for testing the camera
    //if(graphNeedsUpdate)
    //    _mainWindow->execute(false);

    _updateNeeded = false;

    // check to see if any of these items changed while running,
    // set _updateNeeded to true if any still need it
    // this can happen if a slider is still being dragged after
    // a process is started
    // blockFailLoop prevents an infinite loop if a process is failing
    if ( !blockFailLoop ){
       QListIterator<IPProcessStep *> itp(_processList);
       while (itp.hasNext())
       {
           IPProcessStep* step = itp.next();
           if (step->process()->isResultReady() ){
              _updateNeeded = true;
              break;
           }
       }
    }
    

    // call afterProcessing of all steps which were executed this time
    // processes like the camera might request another execution
    QListIterator<IPProcessStep *> it2(_processList);
    while (it2.hasNext())
    {
        IPProcessStep* step = it2.next();
        step->process()->afterProcessing();
    }
}
Ejemplo n.º 8
0
/*
region<int> getDiffer( trackDocument * doc, int areaIndex, int start, int end, int time )
{
	boundaryArea & area = doc->areas[areaIndex];
	boundaryCurve & curve = area.divisions.first();
	boundaryCurveIndex index;
	index.curve = 0;
	index.size = curve.points.size;
	index.start = start;
	index.end = end;
	static array2<bool> flag;
	flag.allocate( doc->width, doc->height );
	region<int> result;
	if ( ! time ) return result;
	area.update( time - 1 );
	area.update( time );
	region<int> prevShape, nowShape;
	{
		list< point2<int> > segments;
		bool checkStart = true;
		for ( boundaryCurveIndex::iterator iti( index ); iti; ++iti ) {
			curve.segment( segments, iti(), time - 1 );
		}
		memset( flag.data, 0, sizeof( bool ) * flag.size );
		for ( list< point2<int> >::iterator itp( segments ); itp; ++itp ) {
			flag( clamp( 0, itp->x, doc->width - 1 ), clamp( 0, itp->y, doc->height - 1 ) ) = true;
		}
		prevShape.set( flag, 0, 0 );
	}
	{
		list< point2<int> > segments;
		bool checkStart = true;
		for ( boundaryCurveIndex::iterator iti( index ); iti; ++iti ) {
			curve.segment( segments, iti(), time );
		}
		memset( flag.data, 0, sizeof( bool ) * flag.size );
		for ( list< point2<int> >::iterator itp( segments ); itp; ++itp ) {
			flag( clamp( 0, itp->x, doc->width - 1 ), clamp( 0, itp->y, doc->height - 1 ) ) = true;
		}
		nowShape.set( flag, 0, 0 );
	}
	region<int> round;
	round = nowShape | prevShape;
	{
		region<int> line;
		point2<int> p1 = curve.points[start]( time - 1 );
		point2<int> p2 = curve.points[start]( time );
		line.line( p1.x, p1.y, p2.x, p2.y );
		round |= line;
	}
	{
		region<int> line;
		point2<int> p1 = curve.points[end]( time - 1 );
		point2<int> p2 = curve.points[end]( time );
		line.line( p1.x, p1.y, p2.x, p2.y );
		round |= line;
	}
	round.fill( result );
	return result;
}
*/
void stateDocument::paint()
{
	trackDocument * doc = trackDocument::get();
	trackView * view = trackView::get();
	if ( ! doc ) return;
	if ( ! view ) return;
	static image viewImage;//画面表示用画像
	viewImage.topdown = false;
	double maxValue = doc->maxValues[doc->currentViewImageIndex];
	double windowLevel = windowLevelBar->get();
	double windowSize = windowSizeBar->get();
	decimal rate = 255.0 / windowSize;
	decimal offset = windowLevel - windowSize / 2;

	imageInterface< pixelLuminance<int16> > * img = & doc->originalImages[doc->currentViewImageIndex];
	switch ( view->mode & trackView::baseImageMask ) {
	case trackView::original:
		break;
	case trackView::vertEdge: 
		img = & doc->verticalEdgeImages[doc->currentViewImageIndex]; 
		break;
	case trackView::horzEdge: 
		img = & doc->horizontalEdgeImages[doc->currentViewImageIndex]; 
		break;
	default:
		offset = 0;
		rate = 0;
		break;
	}
	viewImage.create( img->width, img->height );
	pixel p( 0, 0, 0, 255 );
	if ( rate ) {
		for ( int y = 0; y < img->height; ++y ) {
			for ( int x = 0; x < img->width; ++x ) {
				p.r = p.g = p.b = static_cast<int8>( clamp<decimal>( 0, 
					( img->getInternal( x, y ).y - offset ) * rate, 255.0 ) );
				viewImage.setInternal( x, y, p );
			}
		}
	} else {
		for ( int y = 0; y < img->height; ++y ) {
			for ( int x = 0; x < img->width; ++x ) {
				viewImage.setInternal( x, y, p );
			}
		}
	}
	//波の表示用の色
	pixel colorV( 0, 0, 255, 255 );
	pixel colorH( 0, 255, 0, 255 );
	pixel colorA( 255, 255, 0, 255 );
	pixel colorD( 255, 0, 255, 255 );
	//論文投稿用の表示
	if ( false && ( ( view->mode & trackView::baseImageMask ) == trackView::none ) ) {
		p.r = p.g = p.b = 0;
		for ( int y = 0; y < img->height; ++y ) {
			for ( int x = 0; x < img->width; ++x ) {
				viewImage.setInternal( x, y, p );
			}
		}
		for ( int t = 0; t < doc->sizeTime(); ++t ) {
			pixel c;
			if ( view->mode & trackView::vertical ) {
				for ( array< list<link> >::iterator ita( doc->verticalLinks ); ita; ++ita ) {
					for ( list<link>::iterator it( ita() ); it; ++it ) {
						c.r = c.g = c.b = clamp<int>( 0, it->reliability * 255, 255 );
						int x = it->cx * doc->wave[t] + it->bx;
						int y = it->cy * doc->wave[t] + it->by;
						viewImage.set( x, y, blendMax( viewImage.get( x, y ), c ) );
					}
				}
			}
			if ( view->mode & trackView::horizontal ) {
				for ( array< list<link> >::iterator ita( doc->horizontalLinks ); ita; ++ita ) {
					for ( list<link>::iterator it( ita() ); it; ++it ) {
						c.r = c.g = c.b = clamp<int>( 0, it->reliability * 255, 255 );
						int x = it->cx * doc->wave[t] + it->bx;
						int y = it->cy * doc->wave[t] + it->by;
						viewImage.set( x, y, blendMax( viewImage.get( x, y ), c ) );
					}
				}
			}
			if ( view->mode & trackView::ascent ) {
				for ( array< list<link> >::iterator ita( doc->ascentLinks ); ita; ++ita ) {
					for ( list<link>::iterator it( ita() ); it; ++it ) {
						c.r = c.g = c.b = clamp<int>( 0, it->reliability * 255, 255 );
						int x = it->cx * doc->wave[t] + it->bx;
						int y = it->cy * doc->wave[t] + it->by;
						viewImage.set( x, y, blendMax( viewImage.get( x, y ), c ) );
					}
				}
			}
			if ( view->mode & trackView::descent ) {
				for ( array< list<link> >::iterator ita( doc->descentLinks ); ita; ++ita ) {
					for ( list<link>::iterator it( ita() ); it; ++it ) {
						c.r = c.g = c.b = clamp<int>( 0, it->reliability * 255, 255 );
						int x = it->cx * doc->wave[t] + it->bx;
						int y = it->cy * doc->wave[t] + it->by;
						viewImage.set( x, y, blendMax( viewImage.get( x, y ), c ) );
					}
				}
			}
		}
	} else
	if ( view->mode != trackView::original ) {
/*
		if ( view->mode & trackView::vertical ) {
			checkMaximum<double> mx;
			for ( array< list<link> >::iterator ita( doc->verticalLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					mx( it->intensity );
				}
			}
			for ( array< list<link> >::iterator ita( doc->verticalLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorV;
					c.a = clamp<int>( 0, c.a * it->intensity / mx(), 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
		if ( view->mode & trackView::horizontal ) {
			checkMaximum<double> mx;
			for ( array< list<link> >::iterator ita( doc->horizontalLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					mx( it->intensity );
				}
			}
			for ( array< list<link> >::iterator ita( doc->horizontalLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorH;
					c.a = clamp<int>( 0, c.a * it->intensity / mx(), 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
		if ( view->mode & trackView::ascent ) {
			checkMaximum<double> mx;
			for ( array< list<link> >::iterator ita( doc->ascentLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					mx( it->intensity );
				}
			}
			for ( array< list<link> >::iterator ita( doc->ascentLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorA;
					c.a = clamp<int>( 0, c.a * it->intensity / mx(), 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
		if ( view->mode & trackView::descent ) {
			checkMaximum<double> mx;
			for ( array< list<link> >::iterator ita( doc->descentLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					mx( it->intensity );
				}
			}
			for ( array< list<link> >::iterator ita( doc->descentLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorD;
					c.a = clamp<int>( 0, c.a * it->intensity / mx(), 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}

		*/
		if ( view->mode & trackView::vertical ) {
			for ( array< list<link> >::iterator ita( doc->verticalLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorV;
					c.a = clamp<int>( 0, c.a * it->reliability, 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
		if ( view->mode & trackView::horizontal ) {
			for ( array< list<link> >::iterator ita( doc->horizontalLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorH;
					c.a = clamp<int>( 0, c.a * it->reliability, 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
		if ( view->mode & trackView::ascent ) {
			for ( array< list<link> >::iterator ita( doc->ascentLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorA;
					c.a = clamp<int>( 0, c.a * it->reliability, 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
		if ( view->mode & trackView::descent ) {
			for ( array< list<link> >::iterator ita( doc->descentLinks ); ita; ++ita ) {
				for ( list<link>::iterator it( ita() ); it; ++it ) {
					pixel c = colorD;
					c.a = clamp<int>( 0, c.a * it->reliability, 255 );
					int x = it->cx * doc->wave[doc->currentViewImageIndex] + it->bx;
					int y = it->cy * doc->wave[doc->currentViewImageIndex] + it->by;
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
	}
	/*
	for ( int i = 0; i < 4; ++i ) {
		for ( array2<flicker>::iterator it( doc->flickers[i] ); it; ++it ) {
			if ( it->value < 0.25 ) continue;
			pixel c( 0, 255, 0, 255 );
			c.a = clamp<int>( 0, c.a * it->value, 128 );
			const point2<int> & pos = it->lnk.position( doc->currentViewImageIndex, doc->wave );
			int x = pos.x, y = pos.y;
			viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
		}
	}
	*/
	for ( list< boundaryArea >::iterator it( doc->areas ); it; ++it ) {
		it->update( doc->currentViewImageIndex );
	}
	list< point2<int> > points;
	pixel linecolor( 255, 255, 0, 128 );
	pixel pointcolor( 0, 255, 0, 255 );
	pixel itnitialpointcolor( 0, 0, 255, 255 );
	pixel editedpointcolor( 255, 0, 0, 255 );
	/*
	for ( list< boundaryArea >::iterator it( doc->areas ); it; ++it ) {
		boundaryArea & area = it();
		if ( ! area.enable ) continue;
		pixel areacolor( 0, 0, 0, 64 );
		for ( list< boundaryPart >::iterator ita( area.parts ); ita; ++ita ) {
			areacolor.r = rand() % 256;
			areacolor.g = rand() % 256;
			areacolor.b = rand() % 256;
			areacolor.a = 128;
			boundaryPart & part = ita();
			for ( region<int>::iterator itp( part.shapes[doc->currentViewImageIndex] ); itp; ++itp ) {
				int x = itp->x;
				int y = itp->y;
				viewImage.set( x, y, blend( viewImage.get( x, y ), areacolor ) );
			}
		}
	}
	*/
	for ( list< boundaryArea >::iterator it( doc->areas ); it; ++it ) {
		//曲線の表示
		if ( doc->show_curve )
		{
			for ( list< point2<int> >::iterator itp( it->boundaryCurves[doc->currentViewImageIndex] ); itp; ++itp ) {
				const point2<int> & p = itp();
				int x = p.x;
				int y = p.y;
				viewImage.set( x, y, blend( viewImage.get( x, y ), linecolor ) );
			}
		}
		//制御点の表示
		for ( list<boundaryPoint*>::iterator itc( it->controlPoints ); itc; ++itc ) {
			boundaryPoint & bp = *itc();
			const point2<int> & p = bp( doc->currentViewImageIndex );
			pixel c;
			switch ( bp.type( doc->currentViewImageIndex ) ) {
			case boundaryPointFrame::typeInitial: c = itnitialpointcolor; break;
			case boundaryPointFrame::typeEdited: c = editedpointcolor; break;
			case boundaryPointFrame::typeInterpolated: c = pointcolor; break;
			default: c = pointcolor; break;
			}
			for ( int y = p.y - 1; y <= p.y + 1; ++y ) {
				for ( int x = p.x - 1; x <= p.x + 1; ++x ) {
					viewImage.set( x, y, blend( viewImage.get( x, y ), c ) );
				}
			}
		}
	}
	paint( viewImage );
}