Skip to content

Commit

Permalink
add collaborate function
Browse files Browse the repository at this point in the history
  • Loading branch information
zackzhy committed Feb 25, 2025
1 parent dee45a6 commit f3442e0
Show file tree
Hide file tree
Showing 65 changed files with 54 additions and 15 deletions.
Binary file added package/D3Dcompiler_47.dll
Binary file not shown.
Binary file added package/Qt6Core.dll
Binary file not shown.
Binary file added package/Qt6Core5Compat.dll
Binary file not shown.
Binary file added package/Qt6Gui.dll
Binary file not shown.
Binary file added package/Qt6Network.dll
Binary file not shown.
Binary file added package/Qt6OpenGL.dll
Binary file not shown.
Binary file added package/Qt6OpenGLWidgets.dll
Binary file not shown.
Binary file added package/Qt6Svg.dll
Binary file not shown.
Binary file added package/Qt6Widgets.dll
Binary file not shown.
Binary file added package/Qt6Xml.dll
Binary file not shown.
Binary file added package/Vaa3D-x.exe
Binary file not shown.
Binary file added package/generic/qtuiotouchplugin.dll
Binary file not shown.
Binary file added package/iconengines/qsvgicon.dll
Binary file not shown.
Binary file added package/imageformats/qgif.dll
Binary file not shown.
Binary file added package/imageformats/qico.dll
Binary file not shown.
Binary file added package/imageformats/qjpeg.dll
Binary file not shown.
Binary file added package/imageformats/qsvg.dll
Binary file not shown.
Binary file added package/libgcc_s_seh-1.dll
Binary file not shown.
Binary file added package/libstdc++-6.dll
Binary file not shown.
Binary file added package/libwinpthread-1.dll
Binary file not shown.
Binary file not shown.
Binary file added package/opengl32sw.dll
Binary file not shown.
Binary file added package/platforms/qwindows.dll
Binary file not shown.
Binary file added package/styles/qwindowsvistastyle.dll
Binary file not shown.
Binary file added package/tls/qcertonlybackend.dll
Binary file not shown.
Binary file added package/tls/qopensslbackend.dll
Binary file not shown.
Binary file added package/tls/qschannelbackend.dll
Binary file not shown.
Binary file added package/translations/qt_ar.qm
Binary file not shown.
Binary file added package/translations/qt_bg.qm
Binary file not shown.
Binary file added package/translations/qt_ca.qm
Binary file not shown.
Binary file added package/translations/qt_cs.qm
Binary file not shown.
Binary file added package/translations/qt_da.qm
Binary file not shown.
Binary file added package/translations/qt_de.qm
Binary file not shown.
Binary file added package/translations/qt_en.qm
Binary file not shown.
Binary file added package/translations/qt_es.qm
Binary file not shown.
Binary file added package/translations/qt_fa.qm
Binary file not shown.
Binary file added package/translations/qt_fi.qm
Binary file not shown.
Binary file added package/translations/qt_fr.qm
Binary file not shown.
Binary file added package/translations/qt_gd.qm
Binary file not shown.
Binary file added package/translations/qt_he.qm
Binary file not shown.
Binary file added package/translations/qt_hr.qm
Binary file not shown.
Binary file added package/translations/qt_hu.qm
Binary file not shown.
Binary file added package/translations/qt_it.qm
Binary file not shown.
Binary file added package/translations/qt_ja.qm
Binary file not shown.
Binary file added package/translations/qt_ko.qm
Binary file not shown.
Binary file added package/translations/qt_lv.qm
Binary file not shown.
Binary file added package/translations/qt_nl.qm
Binary file not shown.
Binary file added package/translations/qt_nn.qm
Binary file not shown.
Binary file added package/translations/qt_pl.qm
Binary file not shown.
Binary file added package/translations/qt_pt_BR.qm
Binary file not shown.
Binary file added package/translations/qt_ru.qm
Binary file not shown.
Binary file added package/translations/qt_sk.qm
Binary file not shown.
Binary file added package/translations/qt_tr.qm
Binary file not shown.
Binary file added package/translations/qt_uk.qm
Binary file not shown.
Binary file added package/translations/qt_zh_CN.qm
Binary file not shown.
Binary file added package/translations/qt_zh_TW.qm
Binary file not shown.
3 changes: 3 additions & 0 deletions v3d_main/3drenderer/nstroke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,9 @@ void Renderer_gl1::segEnd2SegIDmapping(My4DImage* curImg)
//this->tail2SegIDmap.clear();
for (vector<V_NeuronSWC>::iterator it = curImg->tracedNeuron.seg.begin(); it != curImg->tracedNeuron.seg.end(); ++it)
{
if(it->row.size() == 0){
continue;
}
double xLabelTail = it->row.begin()->x;
double yLabelTail = it->row.begin()->y;
double zLabelTail = it->row.begin()->z;
Expand Down
10 changes: 6 additions & 4 deletions v3d_main/3drenderer/nstroke_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4788,8 +4788,9 @@ set<size_t> Renderer_gl1::segEndRegionCheck(My4DImage* curImg, size_t inputSegID
//cout << *headIt << " ";
for (vector<V_NeuronSWC_unit>::iterator nodeIt = curImg->tracedNeuron.seg[*headIt].row.begin(); nodeIt != curImg->tracedNeuron.seg[*headIt].row.end(); ++nodeIt)
{
if (nodeIt->x == (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->x && nodeIt->y == (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->y && nodeIt->z == (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->z)
otherConnectedSegs.insert(*headIt);
// if (nodeIt->x == (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->x && nodeIt->y == (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->y && nodeIt->z == (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->z)
if (fabs(nodeIt->x - (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->x) < 1e-5 && fabs(nodeIt->y - (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->y) < 1e-5 && fabs(nodeIt->z - (curImg->tracedNeuron.seg[inputSegID].row.end() - 1)->z) < 1e-5)
otherConnectedSegs.insert(*headIt);
}
}
//cout << endl << " Tail region segs:";
Expand All @@ -4803,8 +4804,9 @@ set<size_t> Renderer_gl1::segEndRegionCheck(My4DImage* curImg, size_t inputSegID
//cout << *tailIt << " ";
for (vector<V_NeuronSWC_unit>::iterator nodeIt = curImg->tracedNeuron.seg[*tailIt].row.begin(); nodeIt != curImg->tracedNeuron.seg[*tailIt].row.end(); ++nodeIt)
{
if (nodeIt->x == curImg->tracedNeuron.seg[inputSegID].row.begin()->x && nodeIt->y == curImg->tracedNeuron.seg[inputSegID].row.begin()->y && nodeIt->z == curImg->tracedNeuron.seg[inputSegID].row.begin()->z)
otherConnectedSegs.insert(*tailIt);
// if (nodeIt->x == curImg->tracedNeuron.seg[inputSegID].row.begin()->x && nodeIt->y == curImg->tracedNeuron.seg[inputSegID].row.begin()->y && nodeIt->z == curImg->tracedNeuron.seg[inputSegID].row.begin()->z)
if (fabs(nodeIt->x - curImg->tracedNeuron.seg[inputSegID].row.begin()->x) < 1e-5 && fabs(nodeIt->y - curImg->tracedNeuron.seg[inputSegID].row.begin()->y) < 1e-5 && fabs(nodeIt->z - curImg->tracedNeuron.seg[inputSegID].row.begin()->z) < 1e-5)
otherConnectedSegs.insert(*tailIt);
}
}
//cout << endl;
Expand Down
8 changes: 4 additions & 4 deletions v3d_main/3drenderer/v3dr_glwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5870,12 +5870,12 @@ bool V3dR_GLWidget::simpleConnectExecutor(V_NeuronSWC_list& segments, vector<seg
// qDebug()<<"(zll-debug)branchSeg.head_tail="<<branchSeg.head_tail;
if (branchSeg.head_tail == -1) // head to head
{
for (vector<V_NeuronSWC_unit>::iterator itNextSeg = segments.seg[branchSeg.segID].row.end() - 1;
itNextSeg >= segments.seg[branchSeg.segID].row.begin(); --itNextSeg)
{
for (vector<V_NeuronSWC_unit>::iterator itNextSeg = segments.seg[branchSeg.segID].row.end() - 1;
itNextSeg >= segments.seg[branchSeg.segID].row.begin(); --itNextSeg)
{
itNextSeg->seg_id = branchSeg.segID;
segments.seg[mainSeg.segID].row.push_back(*itNextSeg);
}
}
}
else if (branchSeg.head_tail == 2) // head to tail
{
Expand Down
7 changes: 7 additions & 0 deletions v3d_main/terafly/src/control/CPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ void TeraFly::doaction(const QString &action_name)
}
}

void TeraFly::closePMain(){
if(PMain::getInstance()){
PMain::uninstance();
PMain::getInstance()->deleteLater();
}
}

// returns true if version >= min_required_version, where version format is version.major.minor
bool TeraFly::checkVersion(std::string version, std::string min_required_version)
{
Expand Down
1 change: 1 addition & 0 deletions v3d_main/terafly/src/control/CPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ class terafly::TeraFly : public QObject
// access points
static void domenu(const QString &menu_name, V3DPluginCallback2 &callback, QWidget *parent);
static void doaction(const QString &action_name);
static void closePMain();

// returns true if version >= min_required_version, where version format is version.major.minor
static bool checkVersion(std::string version, std::string min_required_version);
Expand Down
32 changes: 27 additions & 5 deletions v3d_main/terafly/src/presentation/PMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ PMain* PMain::getInstance()
else
{
tf::warning("TeraFly not yet instantiated", __itm__current__function__);
QMessageBox::critical(0,QObject::tr("Error"), QObject::tr("TeraFly not yet instantiated"),QObject::tr("Ok"));
// QMessageBox::critical(0,QObject::tr("Error"), QObject::tr("TeraFly not yet instantiated"),QObject::tr("Ok"));
return 0;
}
}
Expand Down Expand Up @@ -185,6 +185,13 @@ PMain::~PMain()
/**/tf::debug(tf::LEV1, 0, __itm__current__function__);
}

QIcon PMain::getIcon(QString path, int w, int h){
QPixmap pixmap(path);
QPixmap scaledPixmap = pixmap.scaled(w, h, Qt::KeepAspectRatio);
QIcon icon(scaledPixmap);
return icon;
}

PMain::PMain(V3DPluginCallback2 *callback, QWidget *parent) : QWidget(parent)
{
/**/tf::debug(tf::LEV1, 0, __itm__current__function__);
Expand Down Expand Up @@ -226,7 +233,7 @@ PMain::PMain(V3DPluginCallback2 *callback, QWidget *parent) : QWidget(parent)
closeVolumeAction = new QAction(QIcon(":/icons/close.png"), "Close image", this);
//saveandchangetype=new QAction(QIcon(":/icons/changetype.png"),"Change curren types",this);
//returntochangedtype=new QAction(QIcon(":/icons/returntype.png"),"Return curren types",this);
loadAnnotationsAction = new QAction(QIcon(":/icons/open_ano.png"), "Load annotations", this);
loadAnnotationsAction = new QAction(getIcon(":/icons/open_ano.png", 50, 50), "Load annotations", this);
saveAnnotationsAction = new QAction(QIcon(":/icons/save.png"), "Save annotations", this);
saveAnnotationsAfterRemoveDupNodesAction=new QAction("Remove dup nodes before saving annotations",this);
saveAnnotationsAsAction = new QAction(QIcon(":/icons/saveas.png"), "Save annotations as", this);
Expand Down Expand Up @@ -277,6 +284,7 @@ PMain::PMain(V3DPluginCallback2 *callback, QWidget *parent) : QWidget(parent)
fileMenu->addAction(clearAnnotationsAction);
fileMenu->addSeparator();
fileMenu->addAction(exitAction);
// fileMenu->setStyleSheet("QMenu::item { min-height: 30px; }");
#ifdef __ALLOW_VR_FUNCS__
/*----------------collaborate mdoe-------------------*/
collaborateMenu=menuBar->addMenu("Collaborate");
Expand Down Expand Up @@ -1221,7 +1229,7 @@ PMain::PMain(V3DPluginCallback2 *callback, QWidget *parent) : QWidget(parent)
layout->setSpacing(0);
setContentsMargins(0, 0, 0, 0);
setLayout(layout);
setWindowTitle(QString("TeraFly v").append(terafly::version.c_str()));
setWindowTitle(QString("CAR-WS v").append(terafly::version.c_str()));
this->setFont(tinyFont);

// signals and slots
Expand Down Expand Up @@ -1373,8 +1381,8 @@ void PMain::reset()
// T0_sbox->setValue(0);
// T1_sbox->setValue(0);
frameCoord->setText("");
refSys->setXRotation(200);
refSys->setYRotation(50);
refSys->setXRotation(180);
refSys->setYRotation(40);
refSys->setZRotation(0);
refSys->setFilled(true);
refSys->setDims(1,1,1);
Expand Down Expand Up @@ -2455,6 +2463,14 @@ void PMain::importDone(RuntimeException *ex, qint64 elapsed_time)
info_page->showVirtualPyramidTab();
}

// 获取屏幕尺寸
QRect screenGeometry = QApplication::primaryScreen()->geometry();
int screenWidth = screenGeometry.width();
int screenHeight = screenGeometry.height();
int curWidth = uniqueInstance->width();
uniqueInstance->resize(curWidth, screenHeight - 100);

new_win->resize(screenWidth - curWidth - 100, screenHeight - 100);
}

//resetting some widgets
Expand Down Expand Up @@ -2951,13 +2967,19 @@ void PMain::doTeraflyVRView()
}
}

void PMain::doimageVRView(bool flag){
CViewer *cur_win = CViewer::getCurrent();
cur_win->view3DWidget->doimageVRView(flag);
}

void PMain::showPMain(){
this->show();
}

void PMain::doCollaborationVRView()
{
qDebug()<<"PMain::doCollaborationVRView()";
timerCheckConn->stop();
try
{
CViewer *cur_win = CViewer::getCurrent();
Expand Down
1 change: 1 addition & 0 deletions v3d_main/terafly/src/presentation/PMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class terafly::PMain : public QWidget
static PMain* uniqueInstance;
PMain(){ /**/tf::debug(tf::LEV1, 0, __itm__current__function__); }
PMain(V3DPluginCallback2 *callback, QWidget *parent);
QIcon getIcon(QString path, int w, int h);

//members
V3DPluginCallback2* V3D_env; //handle of V3D environment
Expand Down
4 changes: 3 additions & 1 deletion v3d_main/v3d/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ MainWindow::MainWindow()
////qDebug()<<"jazz---------------debug---------------4";
//const GLubyte* OpenGLVersion = glGetString(GL_VERSION);
////qDebug()<<"jazz---------------debug---------------5";

func_open_terafly();
}

//void MainWindow::postClose() //090812 RZC
Expand Down Expand Up @@ -312,7 +312,9 @@ void MainWindow::closeEvent(QCloseEvent *event)

//if (workspace) workspace->deleteLater(); //110802 RZC //will call ~XFormView to raise BAD_ACCESS
disconnect(workspace, SIGNAL(windowActivated(QWidget *)), this, SLOT(updateMenus())); //instead of above line
terafly::TeraFly::closePMain();
V3dApplication::handleCloseEvent(event);
return;
}
void MainWindow::transactionStart()
{
Expand Down
3 changes: 2 additions & 1 deletion v3d_main/vrrenderer/v3dr_gl_vr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3776,7 +3776,8 @@ void CMainApplication::ProcessVREvent( const vr::VREvent_t & event )
}

//special situation for splitnode in head or end
if((nearestNode==*nearestNT.listNeuron.begin())||(nearestNode==nearestNT.listNeuron.back())/*||nearestNT.listNeuron.size()<=3||nearestNode==*(nearestNT.listNeuron.begin()+1)||nearestNode==*(nearestNT.listNeuron.end()-2)*/)
if((nearestNode==*nearestNT.listNeuron.begin())||(nearestNode==nearestNT.listNeuron.back())/*||nearestNT.listNeuron.size()<=3||nearestNode==*
(nearestNT.listNeuron.begin()+1)||nearestNode==*(nearestNT.listNeuron.end()-2)*/)
{
qDebug()<<"split node in hear/end or neuron is too short";
break;
Expand Down

0 comments on commit f3442e0

Please sign in to comment.