白板标注功能提供了会议中的协作工具,支持实时白板绘制和内容标注。通过白板功能,参会者可以在会议中进行实时绘图、标注和协作,提升会议互动性和协作效率。
在会议中启用白板功能:
// 开启白板 - 启动白板功能
NemoSdkAdaptor::getInstance()->startWhiteboard();
// 开启标注功能 - 启动标注功能
NemoSdkAdaptor::getInstance()->startAnnotation();
在白板上进行绘制和标注:
// 发送白板画线 - 绘制红色线条,宽度2像素
XYWhiteboardLine line;
line.points = {{100, 100}, {200, 200}};
line.color = 0xFF0000; // 红色
line.width = 2;
NemoSdkAdaptor::getInstance()->sendWhiteboardLine(line);
// 发送标注画线 - 绘制绿色线条,宽度3像素
XYAnnotationLine annotationLine;
annotationLine.points = {{150, 150}, {250, 250}};
annotationLine.color = 0x00FF00; // 绿色
annotationLine.width = 3;
NemoSdkAdaptor::getInstance()->sendAnnotationLine(annotationLine);
清理绘制内容并关闭功能:
// 清空白板 - 清除所有白板内容
NemoSdkAdaptor::getInstance()->cleanWhiteboard();
// 清空标注 - 清除所有标注内容
NemoSdkAdaptor::getInstance()->cleanAnnotation();
// 关闭白板 - 停止白板功能
NemoSdkAdaptor::getInstance()->stopWhiteboard();
// 关闭标注 - 停止标注功能
NemoSdkAdaptor::getInstance()->stopAnnotation();
API: startWhiteboard
接口定义:
virtual void startWhiteboard() = 0;
示例:
NemoSdkAdaptor::getInstance()->startWhiteboard();
API: stopWhiteboard
接口定义:
virtual void stopWhiteboard() = 0;
示例:
NemoSdkAdaptor::getInstance()->stopWhiteboard();
API: cleanWhiteboard
接口定义:
virtual void cleanWhiteboard() = 0;
示例:
NemoSdkAdaptor::getInstance()->cleanWhiteboard();
API: sendWhiteboardLine
接口定义:
virtual void sendWhiteboardLine(const XYLine& line) = 0;
参数:
line
(XYLine&): 白板画线数据,包含线条的坐标和属性信息示例:
XYLine line;
line.startX = 100;
line.startY = 100;
line.endX = 200;
line.endY = 200;
line.color = 0xFF0000; // 红色
line.width = 2;
NemoSdkAdaptor::getInstance()->sendWhiteboardLine(line);
line.color = 0xFF0000; // 红色
line.width = 2;
line.style = XYLineStyle_Solid;
NemoSdkAdaptor::getInstance()->sendWhiteboardLine(line);
### 2. 标注控制
#### 开启标注
**API**: [startAnnotation](/common/meeting/api/whiteboard_annotation?platform=cppsdk#TGz5W)
**接口定义:**
```cpp
virtual void startAnnotation() = 0;
示例:
NemoSdkAdaptor::getInstance()->startAnnotation();
API: stopAnnotation
接口定义:
virtual void stopAnnotation() = 0;
示例:
NemoSdkAdaptor::getInstance()->stopAnnotation();
API: cleanAnnotation
接口定义:
virtual void cleanAnnotation() = 0;
示例:
NemoSdkAdaptor::getInstance()->cleanAnnotation();
API: sendAnnotationLine
接口定义:
virtual void sendAnnotationLine(const XYLine& line) = 0;
参数:
line
(XYLine&): 标注画线数据,包含线条的坐标和属性信息示例:
XYLine line;
line.startX = 150;
line.startY = 150;
line.endX = 250;
line.endY = 250;
line.color = 0x00FF00; // 绿色
line.width = 3;
NemoSdkAdaptor::getInstance()->sendAnnotationLine(line);
接口定义:
virtual void notifyAnnotationState(bool state) = 0;
参数:
state
(bool): 标注状态,true表示开始标注,false表示结束标注示例:
// 通知标注开始
NemoSdkAdaptor::getInstance()->notifyAnnotationState(true);
// 通知标注结束
NemoSdkAdaptor::getInstance()->notifyAnnotationState(false);
class WhiteboardAnnotationManager {
private:
bool _isWhiteboardActive = false;
bool _isAnnotationActive = false;
QList<XYWhiteboardLine> _whiteboardLines;
QList<XYAnnotationLine> _annotationLines;
public:
// 白板控制
void startWhiteboard() {
if (!_isWhiteboardActive) {
NemoSdkAdaptor::getInstance()->startWhiteboard();
_isWhiteboardActive = true;
}
}
void stopWhiteboard() {
if (_isWhiteboardActive) {
NemoSdkAdaptor::getInstance()->stopWhiteboard();
_isWhiteboardActive = false;
}
}
void cleanWhiteboard() {
NemoSdkAdaptor::getInstance()->cleanWhiteboard();
_whiteboardLines.clear();
}
void sendWhiteboardLine(const QList<QPoint>& points, uint32_t color = 0xFF0000, int width = 2) {
XYWhiteboardLine line;
for (const QPoint& point : points) {
XYPoint xyPoint;
xyPoint.x = point.x();
xyPoint.y = point.y();
line.points.push_back(xyPoint);
}
line.color = color;
line.width = width;
line.style = XYLineStyle_Solid;
NemoSdkAdaptor::getInstance()->sendWhiteboardLine(line);
_whiteboardLines.append(line);
}
// 标注控制
void startAnnotation() {
if (!_isAnnotationActive) {
NemoSdkAdaptor::getInstance()->startAnnotation();
_isAnnotationActive = true;
}
}
void stopAnnotation() {
if (_isAnnotationActive) {
NemoSdkAdaptor::getInstance()->stopAnnotation();
_isAnnotationActive = false;
}
}
void cleanAnnotation() {
NemoSdkAdaptor::getInstance()->cleanAnnotation();
_annotationLines.clear();
}
void sendAnnotationLine(const QList<QPoint>& points, uint32_t color = 0x00FF00, int width = 3) {
XYAnnotationLine line;
for (const QPoint& point : points) {
XYPoint xyPoint;
xyPoint.x = point.x();
xyPoint.y = point.y();
line.points.push_back(xyPoint);
}
line.color = color;
line.width = width;
line.style = XYLineStyle_Dashed;
NemoSdkAdaptor::getInstance()->sendAnnotationLine(line);
_annotationLines.append(line);
}
void notifyAnnotationState(XYAnnotationState state) {
NemoSdkAdaptor::getInstance()->notifyAnnotationState(state);
}
// 白板回调
void onWhiteboardStart() {
qDebug() << "Whiteboard started";
_isWhiteboardActive = true;
emit whiteboardStarted();
}
void onWhiteboardStop() {
qDebug() << "Whiteboard stopped";
_isWhiteboardActive = false;
emit whiteboardStopped();
}
void onWhiteboardReceiveLine(const XYWhiteboardLine& line) {
qDebug() << "Received whiteboard line with" << line.points.size() << "points";
_whiteboardLines.append(line);
emit whiteboardLineReceived(line);
}
void onWhiteboardClean() {
qDebug() << "Whiteboard cleaned";
_whiteboardLines.clear();
emit whiteboardCleaned();
}
// 标注回调
void onAnnotationStart() {
qDebug() << "Annotation started";
_isAnnotationActive = true;
emit annotationStarted();
}
void onAnnotationStop() {
qDebug() << "Annotation stopped";
_isAnnotationActive = false;
emit annotationStopped();
}
void onAnnotationReceiveLine(const XYAnnotationLine& line) {
qDebug() << "Received annotation line with" << line.points.size() << "points";
_annotationLines.append(line);
emit annotationLineReceived(line);
}
void onAnnotationClean() {
qDebug() << "Annotation cleaned";
_annotationLines.clear();
emit annotationCleaned();
}
void onAnnotationLineRecvFeedback(const XYString& feedback) {
QString feedbackStr(feedback.str());
qDebug() << "Annotation line feedback:" << feedbackStr;
emit annotationLineFeedback(feedbackStr);
}
// Getter方法
bool isWhiteboardActive() const { return _isWhiteboardActive; }
bool isAnnotationActive() const { return _isAnnotationActive; }
QList<XYWhiteboardLine> getWhiteboardLines() const { return _whiteboardLines; }
QList<XYAnnotationLine> getAnnotationLines() const { return _annotationLines; }
};
struct XYWhiteboardLine {
std::vector<XYPoint> points; // 画线点集合
uint32_t color; // 颜色值 (RGB)
int width; // 线宽
XYLineStyle style; // 线型样式
};
struct XYAnnotationLine {
std::vector<XYPoint> points; // 画线点集合
uint32_t color; // 颜色值 (RGB)
int width; // 线宽
XYLineStyle style; // 线型样式
};
struct XYPoint {
int x; // X坐标
int y; // Y坐标
};
白板功能提供实时协作绘图能力,包括:
标注功能允许在共享内容上进行标注,包括:
白板标注功能支持多人协作,包括:
方法 | 描述 | 链接 |
开启白板 | ||
关闭白板 | ||
清空白板 | ||
发送白板画线 | ||
开启标注 | ||
关闭标注 | ||
清空标注 | ||
发送标注画线 | ||
通知采集开始/结束标注 |
回调 | 描述 | 链接 |
白板开始回调 | ||
白板停止回调 | ||
白板画线接收回调 | ||
白板清理回调 | ||
标注开始回调 | ||
标注停止回调 | ||
标注画线接收回调 | ||
标注清理回调 | ||
标注画线接收反馈回调 |
枚举 | 描述 | 链接 |
线型样式枚举 | ||
标注状态枚举 |
数据结构 | 描述 | 链接 |
白板画线数据结构 | ||
标注画线数据结构 | ||
点坐标数据结构 |