QModelIndex CObjectModel::addItem(QString name, const QModelIndex &parent)
{
	ObjectItem *p = getItemFromIndex(parent) ;
	int row = p->childCount() ;

	return insertItem(row, name, parent) ;
}
bool Anm2DAsm::makeFromEditData2Inc(EditData &rEditData, QString qsFname)
{
    qsFname = QFileInfo(qsFname).baseName().toUpper();
    m_pModel = rEditData.getObjectModel();
    if (m_bFlat)
    {
        ObjectModel *p = new ObjectModel();
        p->copy(m_pModel);
        p->flat();
        m_pModel = p;
    }

    ObjectItem *pRoot = m_pModel->getItemFromIndex(QModelIndex());
    //	ObjectItem	*pObj = pRoot->child(0);

    addString("; このファイルはAnimationCreatorにより生成されました。\n");
    addString("\n");
    for (int i = 0; i < pRoot->childCount(); i++)
    {
        ObjectItem *pObj = pRoot->child(i);
        addString("%define\t\tACO_" + qsFname + "__" + pObj->getName().replace(" ", "_").toUpper().toUtf8() + QString("\t\t%1").arg(i) + "\n");
    }
    addString("\n");
    for (int i = 0; i < pRoot->childCount(); i++)
    {
        ObjectItem *pObj = pRoot->child(i);
        QVector4D qv4AreaMin = QVector4D(FLT_MAX, FLT_MAX, FLT_MAX, 0);
        QVector4D qv4AreaMax = QVector4D(FLT_MIN, FLT_MIN, FLT_MIN, 0);
        QString qsLabel = "ACL_" + qsFname + "__" + pObj->getName().replace(" ", "_").toUpper().toUtf8() + "__";
        addString("%define\t\t" + qsLabel + "ROOT\t\t0\n");
        makeFromEditDataArea(pObj, &qv4AreaMin, &qv4AreaMax, true);
        addString("\t\t; Area:" + QString("(%1, %2, %3)-(%4, %5, %6) size:(%7, %8, %9)").arg(qv4AreaMin.x(), 0, 'f').arg(qv4AreaMin.y(), 0, 'f').arg(qv4AreaMin.z(), 0, 'f').arg(qv4AreaMax.x(), 0, 'f').arg(qv4AreaMax.y(), 0, 'f').arg(qv4AreaMax.z(), 0, 'f').arg(qv4AreaMax.x() - qv4AreaMin.x(), 0, 'f').arg(qv4AreaMax.y() - qv4AreaMin.y(), 0, 'f').arg(qv4AreaMax.z() - qv4AreaMin.z(), 0, 'f') + "\n");
        m_nCnt = 1;
        for (int j = 0; j < pObj->childCount(); j++)
        {
            ObjectItem *pChild = pObj->child(j);
            makeFromEditData2IncTip(qsLabel, pChild);
        }
        addString("\n");
    }

    return true;
}
Exemple #3
0
int TreeModel::rowCount(const QModelIndex &parent) const
{
    ObjectItem *parentItem;
    if (parent.column() > 0)
        return 0;

    if (!parent.isValid())
        parentItem = rootItem;
    else
        parentItem = static_cast<ObjectItem*>(parent.internalPointer());

    return parentItem->childCount();
}
void DataMarkerLabel::drawLayer(const QModelIndex &index, QPainter &painter, const QModelIndex selIndex, QList<int> &frames)
{
    if (!index.isValid())
    {
        return;
    }

    ObjectItem *pItem = m_pEditData->getObjectModel()->getItemFromIndex(index);
    if (!pItem)
    {
        return;
    }

    bool bMine = false;
    if (selIndex.isValid() && index == selIndex)
    {
        bMine = true;
    }

    const QList<FrameData> &datas = pItem->getFrameData();
    for (int i = 0; i < datas.size(); i++)
    {
        const FrameData data = datas.at(i);

        if (data.frame < m_frameStart || data.frame > m_frameEnd)
        {
            continue;
        }

        int x0 = getX(data.frame);
        int x1 = getX(data.frame + 1);
        if (x1 < 0)
        {
            continue;
        }
        if (bMine)
        {
            if (m_pressFrame == data.frame)
            {
                continue;
            }
            painter.fillRect(x0, 0, x1 - x0, height() / 3, QColor(255, 0, 0, 128));
        }
        else
        {
            if (frames.indexOf(data.frame) >= 0)
            {
                continue;
            }
            frames.append(data.frame);

            QColor col = QColor(0, 0, 255, 128);
            if (m_pEditData->getObjectModel()->isObject(m_pEditData->getSelIndex()))
            {
                col.setRed(255);
            }
            painter.fillRect(x0, height() / 3, x1 - x0, height() / 3, col);
        }
    }

    for (int i = 0; i < pItem->childCount(); i++)
    {
        QModelIndex child = m_pEditData->getObjectModel()->index(i, 0, index);
        drawLayer(child, painter, selIndex, frames);
    }
}
AnimationForm::AnimationForm(CEditData *pImageData, CSettings *pSetting, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AnimationForm)
{
	m_pEditData		= pImageData ;
	m_pSetting		= pSetting ;
	m_bDontSetData	= false ;
	m_frameStart	= pSetting->getFrameStart() ;
	m_frameEnd		= pSetting->getFrameEnd() ;

	m_oldWinSize = QSize(-1, -1) ;

	ui->setupUi(this);

	m_pEditData->setTreeView(ui->treeView) ;

	ui->label_frame->setEditData(m_pEditData) ;
	ui->label_frame->setHorizontalBar(ui->horizontalScrollBar_frame) ;
	m_pDataMarker = ui->label_frame ;

	setFocusPolicy(Qt::StrongFocus);

	m_pGlWidget = new AnimeGLWidget(pImageData, pSetting, this) ;
	ui->scrollArea_anime->setWidget(m_pGlWidget);
	m_pGlWidget->resize(m_pSetting->getAnmWindowW(), m_pSetting->getAnmWindowH());
	m_pGlWidget->setDrawArea(m_pSetting->getAnmWindowW(), m_pSetting->getAnmWindowH());
	m_pGlWidget->show();

	ui->radioButton_pos->setChecked(true);
	ui->checkBox_grid->setChecked(true);
	ui->spinBox_fps->setValue(60) ;
	ui->checkBox_frame->setChecked(pSetting->getDrawFrame());
	ui->checkBox_center->setChecked(pSetting->getDrawCenter());
	ui->spinBox_frame_start->setValue(m_frameStart) ;
	ui->spinBox_frame_end->setValue(m_frameEnd) ;
	ui->label_frame->slot_setFrameStart(m_frameStart) ;
	ui->label_frame->slot_setFrameEnd(m_frameEnd) ;

	for ( int i = 0 ; i < m_pEditData->getImageDataListSize() ; i ++ ) {
		CEditData::ImageData *p = m_pEditData->getImageData(i) ;
		if ( !p ) { continue ; }
		ui->comboBox_image_no->addItem(tr("%1").arg(p->nNo));
	}

	m_pSplitter = new AnimationWindowSplitter(this) ;
	m_pSplitter->addWidget(ui->treeView) ;
	m_pSplitter->addWidget(ui->scrollArea_anime) ;
	m_pSplitter->setGeometry(ui->treeView->pos().x(),
						   ui->treeView->pos().y(),
						   ui->scrollArea_anime->width()+ui->scrollArea_anime->pos().x()-ui->treeView->pos().x(),
						   ui->treeView->height());

	{
		CObjectModel *pModel = m_pEditData->getObjectModel() ;

		ui->treeView->setModel(pModel);
		ui->treeView->header()->setHidden(true);
		ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu);

		ui->treeView->setDragEnabled(true) ;
		ui->treeView->setAcceptDrops(true) ;
		ui->treeView->setDropIndicatorShown(true) ;
		ui->treeView->setDragDropMode(QAbstractItemView::DragDrop) ;
		ui->treeView->setFocusPolicy(Qt::NoFocus);

		ObjectItem *root = pModel->getItemFromIndex(QModelIndex()) ;
		if ( !root->childCount() ) {
			addNewObject(trUtf8("New Object"));
		}
		else {
			if ( root->child(0) ) {
				QModelIndex index = pModel->index(0) ;
				ui->treeView->setCurrentIndex(index);
			}
		}
	}

	m_pActTreeViewAdd		= new QAction(QString("Add Object"), this);
	m_pActTreeViewCopy		= new QAction(QString("Copy Object"), this) ;
	m_pActTreeViewDel		= new QAction(QString("Delete"), this);
	m_pActTreeViewLayerDisp = new QAction(QString("Disp"), this) ;
	m_pActTreeViewLayerLock = new QAction(QString("Lock"), this) ;

	m_pTimer = new QTimer(this) ;
	m_pTimer->setInterval((int)(100.0f/6.0f));

	connect(ui->label_frame, SIGNAL(sig_changeValue(int)), this, SLOT(slot_frameChanged(int))) ;
	connect(ui->radioButton_pos, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioPos(bool))) ;
	connect(ui->radioButton_rot, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioRot(bool))) ;
	connect(ui->radioButton_center, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioCenter(bool))) ;
	connect(ui->radioButton_scale, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioScale(bool))) ;
	connect(ui->radioButton_path, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioPath(bool))) ;

	connect(ui->treeView, SIGNAL(customContextMenuRequested(QPoint)),	this, SLOT(slot_treeViewMenuReq(QPoint))) ;
	connect(ui->treeView, SIGNAL(clicked(QModelIndex)),					this, SLOT(slot_changeSelectObject(QModelIndex))) ;

	connect(m_pGlWidget, SIGNAL(sig_dropedImage(QRectF, QPoint, int)), this, SLOT(slot_dropedImage(QRectF, QPoint, int))) ;
	connect(m_pGlWidget, SIGNAL(sig_selectLayerChanged(QModelIndex)), this, SLOT(slot_selectLayerChanged(QModelIndex))) ;
	connect(m_pGlWidget, SIGNAL(sig_dragedImage(FrameData)), this, SLOT(slot_setUI(FrameData))) ;
	connect(m_pGlWidget, SIGNAL(sig_deleteFrameData()), this, SLOT(slot_deleteFrameData())) ;
	connect(m_pGlWidget, SIGNAL(sig_selectPrevLayer(QModelIndex, int, FrameData)), this, SLOT(slot_addNewFrameData(QModelIndex, int, FrameData))) ;
	connect(m_pGlWidget, SIGNAL(sig_frameDataMoveEnd(FrameData)), this, SLOT(slot_frameDataMoveEnd(FrameData))) ;
	connect(m_pGlWidget, SIGNAL(sig_dragedImage(FrameData)), this, SLOT(slot_portDragedImage(FrameData))) ;

	connect(ui->doubleSpinBox_pos_x,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changePosX(double))) ;
	connect(ui->doubleSpinBox_pos_y,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changePosY(double))) ;
	connect(ui->doubleSpinBox_pos_z,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changePosZ(double))) ;
	connect(ui->doubleSpinBox_rot_x,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeRotX(double))) ;
	connect(ui->doubleSpinBox_rot_y,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeRotY(double))) ;
	connect(ui->doubleSpinBox_rot_z,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeRotZ(double))) ;
	connect(ui->doubleSpinBox_scale_x,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeScaleX(double))) ;
	connect(ui->doubleSpinBox_scale_y,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeScaleY(double))) ;
	connect(ui->doubleSpinBox_uv_left,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeUvLeft(double))) ;
	connect(ui->doubleSpinBox_uv_right,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeUvRight(double))) ;
	connect(ui->doubleSpinBox_uv_top,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeUvTop(double))) ;
	connect(ui->doubleSpinBox_uv_bottom,SIGNAL(valueChanged(double)),	this, SLOT(slot_changeUvBottom(double))) ;
	connect(ui->doubleSpinBox_center_x,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeCenterX(double))) ;
	connect(ui->doubleSpinBox_center_y,	SIGNAL(valueChanged(double)),	this, SLOT(slot_changeCenterY(double))) ;
	connect(ui->spinBox_frame_start,	SIGNAL(valueChanged(int)),		this, SLOT(slot_changeFrameStart(int))) ;
	connect(ui->spinBox_frame_end,		SIGNAL(valueChanged(int)),		this, SLOT(slot_changeFrameEnd(int))) ;

	connect(m_pActTreeViewAdd,			SIGNAL(triggered()),			this, SLOT(slot_createNewObject())) ;
	connect(m_pActTreeViewCopy,			SIGNAL(triggered()),			this, SLOT(slot_copyObject())) ;
	connect(m_pActTreeViewDel,			SIGNAL(triggered()),			this, SLOT(slot_deleteObject())) ;
	connect(m_pActTreeViewLayerDisp,	SIGNAL(triggered()),			this, SLOT(slot_changeLayerDisp())) ;
	connect(m_pActTreeViewLayerLock,	SIGNAL(triggered()),			this, SLOT(slot_changeLayerLock())) ;

	connect(ui->pushButton_play,		SIGNAL(clicked()),				this, SLOT(slot_playAnimation())) ;
	connect(ui->pushButton_stop,		SIGNAL(clicked()),				this, SLOT(slot_stopAnimation())) ;
	connect(ui->pushButton_backward,	SIGNAL(clicked()),				this, SLOT(slot_backwardFrameData())) ;
	connect(ui->pushButton_forward,		SIGNAL(clicked()),				this, SLOT(slot_forwardFrameData())) ;
	connect(ui->checkBox_grid,			SIGNAL(clicked(bool)),			m_pGlWidget, SLOT(slot_setDrawGrid(bool))) ;
	connect(ui->checkBox_uv_anime,		SIGNAL(clicked(bool)),			this, SLOT(slot_changeUVAnime(bool))) ;
	connect(ui->spinBox_fps,			SIGNAL(valueChanged(int)),		this, SLOT(slot_changeAnimeSpeed(int))) ;
	connect(ui->comboBox_image_no,		SIGNAL(activated(QString)),		this, SLOT(slot_changeImageIndex(QString))) ;
	connect(m_pTimer,					SIGNAL(timeout()),				this, SLOT(slot_timerEvent())) ;
	connect(ui->spinBox_loop,			SIGNAL(valueChanged(int)),		this, SLOT(slot_changeLoop(int))) ;
	connect(ui->spinBox_r,				SIGNAL(valueChanged(int)),		this, SLOT(slot_changeColorR(int))) ;
	connect(ui->spinBox_g,				SIGNAL(valueChanged(int)),		this, SLOT(slot_changeColorG(int))) ;
	connect(ui->spinBox_b,				SIGNAL(valueChanged(int)),		this, SLOT(slot_changeColorB(int))) ;
	connect(ui->spinBox_a,				SIGNAL(valueChanged(int)),		this, SLOT(slot_changeColorA(int))) ;
	connect(ui->checkBox_frame,			SIGNAL(clicked(bool)),			this, SLOT(slot_changeDrawFrame(bool))) ;
	connect(ui->checkBox_center,		SIGNAL(clicked(bool)),			this, SLOT(slot_changeDrawCenter(bool))) ;
	connect(ui->checkBox_linear_filter,	SIGNAL(clicked(bool)),			this, SLOT(slot_changeLinearFilter(bool))) ;
	connect(ui->toolButton_picker,		SIGNAL(clicked()),				this, SLOT(slot_clickPicker())) ;
	connect(m_pSplitter,				SIGNAL(splitterMoved(int,int)), this, SLOT(slot_splitterMoved(int, int))) ;
	connect(m_pEditData->getObjectModel(), SIGNAL(sig_copyIndex(int,ObjectItem*,QModelIndex,Qt::DropAction)), this, SLOT(slot_copyIndex(int, ObjectItem*, QModelIndex,Qt::DropAction))) ;

	connect(ui->pushButton_del_path,	SIGNAL(clicked()),				this, SLOT(slot_delPath())) ;
	connect(this, SIGNAL(sig_changeFrameStart(int)),	ui->label_frame, SLOT(slot_setFrameStart(int))) ;
	connect(this, SIGNAL(sig_changeFrameEnd(int)),		ui->label_frame, SLOT(slot_setFrameEnd(int))) ;

	connect(ui->label_frame, SIGNAL(sig_changeValue(int)), ui->spinBox_nowSequence, SLOT(setValue(int))) ;
	connect(ui->spinBox_nowSequence, SIGNAL(valueChanged(int)), this, SLOT(slot_frameChanged(int))) ;
	connect(ui->horizontalScrollBar_frame, SIGNAL(valueChanged(int)), ui->label_frame, SLOT(slot_moveScrollBar(int))) ;
	connect(ui->label_frame, SIGNAL(sig_moveFrameData(int,int)), this, SLOT(slot_moveFrameData(int,int))) ;

	connect(m_pGlWidget, SIGNAL(sig_scrollWindow(QPoint)), this, SLOT(slot_scrollWindow(QPoint))) ;
}
// ドロップ時のスロット
// レイヤ追加
void AnimationForm::slot_dropedImage( QRectF rect, QPoint pos, int imageIndex )
{
	CObjectModel *pModel = m_pEditData->getObjectModel() ;
	int frameNum  = ui->label_frame->value() ;
	QModelIndex index = ui->treeView->currentIndex() ;

	if ( !index.isValid() ) {
		qWarning() << "slot_dropedImage current index invalid 0" ;
		return ;
	}

	ObjectItem *pObjItem = pModel->getObject(index) ;
	if ( !pObjItem ) {
		qWarning() << "slot_dropedImage current obj 0" ;
		return ;
	}

	if ( !m_pSetting->getLayerHierarchy() ) {
		index = pObjItem->getIndex() ;
	}

	pos -= QPoint((m_pSetting->getAnmWindowW()/2), (m_pSetting->getAnmWindowH()/2)) ;	// GLWidgetのローカルポスに変換

	ObjectItem *pItem = pModel->getItemFromIndex(index) ;
	bool valid ;
	QMatrix4x4 mat = pItem->getDisplayMatrix(frameNum, &valid) ;
	if ( valid ) {
		QMatrix4x4 inv = mat.inverted(&valid) ;
		if ( valid ) {
			pos = inv.map(pos) ;
		}
	}

	index = m_pEditData->cmd_addItem(QString("Layer %1").arg(pObjItem->childCount()), index) ;
	ui->treeView->setCurrentIndex(index) ;
//	m_pEditData->setSelIndex(index) ;

	// ツリービューに追加
    FrameData frameData ;
	frameData.pos_x = pos.x() ;
	frameData.pos_y = pos.y() ;
	frameData.pos_z = 0 ;
	frameData.rot_x =
	frameData.rot_y =
	frameData.rot_z = 0 ;
	frameData.center_x = (rect.width()) / 2 ;
	frameData.center_y = (rect.height()) / 2 ;
	frameData.frame = frameNum ;
	frameData.fScaleX = frameData.fScaleY = 1.0f ;
	frameData.setRect(rect);
	frameData.nImage = imageIndex ;
	frameData.bUVAnime = false ;
	frameData.rgba[0] =
	frameData.rgba[1] =
	frameData.rgba[2] =
	frameData.rgba[3] = 255 ;

	QList<QWidget *> updateWidget ;
	updateWidget << m_pGlWidget ;
	updateWidget << m_pDataMarker ;

	m_pEditData->cmd_addFrameData(index, frameData, updateWidget) ;
}
bool Anm2DAsm::makeFromEditData(EditData &rEditData)
{
    m_pModel = rEditData.getObjectModel();
    if (m_bFlat)
    {
        ObjectModel *p = new ObjectModel();
        p->copy(m_pModel);
        p->flat();
        m_pModel = p;
    }

    ObjectItem *pRoot = m_pModel->getItemFromIndex(QModelIndex());

    // 画像をラベル化
    // 未使用画像をスキップするテーブル構築
    int nVram = 0;
    {
        for (int i = 0; i < rEditData.getImageDataListSize(); i++)
        {
            if (i >= KM_VRAM_MAX)
            {
                return false;
            }
            EditData::ImageData *p = rEditData.getImageData(i);
            if (!p)
                continue;
            QFileInfo fi(p->fileName);
            QString sImageLabel = fi.fileName();
            sImageLabel = QString("ID_") + sImageLabel.replace(".", "_").toUpper();
            sImageLabel = sImageLabel.toUtf8();
            m_aqsVramID[i] = sImageLabel;
            m_bUnused[i] = true;
        }
        for (int i = 0; i < pRoot->childCount(); i++)
        {
            ObjectItem *pObj = pRoot->child(i);
            for (int j = 0; j < pObj->childCount(); j++)
            {
                ObjectItem *pChild = pObj->child(j);
                subUnusedVramSkip(pChild);
            }
        }
        for (int i = 0; i < rEditData.getImageDataListSize(); i++)
        {
            if (m_bUnused[i] == false)
                nVram++;
        }
    }

    addString(";----------------------------------------------------------------\n");
    addString("; @kamefile\t" + pRoot->getName().toUtf8() + "\n");
    addString(";---------------------------------------------------------------- HEADER\n");
    addString("\t\t\%include\t\"../imageid.inc\"\n");
    addString("\n");
    addString(";---------------------------------------------------------------- DATA\n");
    addString("%define\t\tNO_READ\t\t0\n");
    addString("%define\t\tF32(f32)\t\t__float32__(f32)\n");
    addString("data:\n");
    addString(";---------------------------------------------------------------- ANM_HEAD\n");
    addString("\t\t\tdb\t\t'ANM0'\t\t; ANM0\n");
    addString("\t\t\tdd\t\t00000003h\t\t; uVersion\n");
    addString("\t\t\tdd\t\t" + QString("%1").arg(/*rEditData.getImageDataListSize()*/ nVram) + "\t\t; nVram\n");
    addString("\t\t\tdd\t\t.vram\t\t; pauVram\n");
    addString("\t\t\tdd\t\t" + QString("%1").arg(pRoot->childCount()) + "\t\t; nObject\n");
    addString("\t\t\tdd\t\t.object\t\t; paObj\n");
    addString("\t\n");
    addString("\t.vram:\n");
    for (int i = 0; i < rEditData.getImageDataListSize(); i++)
    {
        if (i >= KM_VRAM_MAX)
        {
            return false;
        }
        if (m_bUnused[i])
            continue;
        EditData::ImageData *p = rEditData.getImageData(i);
        if (!p)
            continue;
        QFileInfo fi(p->fileName);
        QString sImageLabel = fi.fileName();
        sImageLabel = QString("ID_") + sImageLabel.replace(".", "_").toUpper();
        sImageLabel = sImageLabel.toUtf8();
        m_aqsVramID[i] = sImageLabel;
        addString("\t\t\tdd\t\t" + m_aqsVramID[i] + "\n");
    }
    addString("\t\n");
    addString("\t.object:\n");
    for (int i = 0; i < pRoot->childCount(); i++)
    {
        addString("\t\t\tdd\t\tanmobj" + QString("%1").arg(i) + "\n");
    }
    addString("\n");
    for (int i = 0; i < pRoot->childCount(); i++)
    {
        ObjectItem *pObj = pRoot->child(i);
        QVector4D qv4AreaMin = QVector4D(FLT_MAX, FLT_MAX, FLT_MAX, 0);
        QVector4D qv4AreaMax = QVector4D(FLT_MIN, FLT_MIN, FLT_MIN, 0);
        addString(";---------------------------------------------------------------- ANM_OBJ\n");
        addString("; " + QString(pObj->getName().toUtf8()) + "\n");
        addString("anmobj" + QString("%1").arg(i) + ":\n");
        if (pObj->childCount())
        {
            if (pObj->getLoop())
            {
                addString("\t\t\tdd\t\t00000001h\t\t; bFlag\n");
            }
            else
            {
                addString("\t\t\tdd\t\t00000000h\t\t; bFlag\n");
            }
            // 最小矩形算出
            for (int j = 0; j < pObj->childCount(); j++)
            {
                ObjectItem *pChild = pObj->child(j);
                makeFromEditDataArea(pChild, &qv4AreaMin, &qv4AreaMax, true);
            }
            addString("\t\t\tdd\t\t" + QString("F32(%1), F32(%2), F32(%3), F32(%4)").arg(qv4AreaMin.x(), 0, 'f').arg(qv4AreaMin.y(), 0, 'f').arg(qv4AreaMax.x(), 0, 'f').arg(qv4AreaMax.y(), 0, 'f') + "\t\t; fvArea\n");
            addString("\t\t\tdd\t\t" + QString("%1").arg(pObj->childCount()) + "\t\t; nTip\n");
            addString("\t\t\tdd\t\t.tips\t\t; papTip\n");
            addString("\t\n");
            addString("\t.tips:\n");
            for (int j = 0; j < pObj->childCount(); j++)
            {
                addString("\t\t\tdd\t\tobj" + QString("%1").arg(i) + "tip" + QString("%1").arg(j) + "\n");
            }
            addString("\n");
            for (int j = 0; j < pObj->childCount(); j++)
            {
                QString qsLabel = "obj" + QString("%1").arg(i) + "tip" + QString("%1").arg(j);
                ObjectItem *pChild = pObj->child(j);
                if (!makeFromEditDataTip(qsLabel, pChild))
                {
                    return false;
                }
            }
        }
        else
        {
            addString("\t\t\tdd\t\t00000000h\t\t; bFlag\n");
            addString("\t\t\tdd\t\t0, 0, 0, 0\t\t; fvArea\n");
            addString("\t\t\tdd\t\t" + QString("%1").arg(pObj->childCount()) + "\t\t; nTip\n");
            addString("\t\t\tdd\t\tNO_READ\t\t; papTip\n");
        }
    }
    addString("\n");

    return true;
}
int CObjectModel::rowCount(const QModelIndex &parent) const
{
	ObjectItem *p = getItemFromIndex(parent) ;
	return p->childCount() ;
}